diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DHyper.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DHyper.java
new file mode 100644
index 0000000000000000000000000000000000000000..5e9496495f0f2323e784fe07a27a48c734b22735
--- /dev/null
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DHyper.java
@@ -0,0 +1,65 @@
+/*
+ * This material is distributed under the GNU General Public License
+ * Version 2. You may review the terms of this license at
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * Copyright (c) 2000-2014, The R Core Team
+ * Copyright (c) 2016, Oracle and/or its affiliates
+ *
+ * All rights reserved.
+ */
+/*
+ *  AUTHOR
+ *    Catherine Loader, catherine@research.bell-labs.com.
+ *    October 23, 2000.
+ *
+ */
+package com.oracle.truffle.r.library.stats;
+
+import static com.oracle.truffle.r.library.stats.Dbinom.dbinomRaw;
+
+import com.oracle.truffle.r.library.stats.DPQ.EarlyReturn;
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function4_1;
+
+public final class DHyper implements Function4_1 {
+    @Override
+    public double evaluate(double x, double r, double b, double n, boolean giveLog) {
+        if (Double.isNaN(x) || Double.isNaN(r) || Double.isNaN(b) || Double.isNaN(n)) {
+            return x + r + b + n;
+        }
+
+        if (DPQ.rdneginonint(r) || DPQ.rdneginonint(b) || DPQ.rdneginonint(n) || n > r + b) {
+            return RMathError.defaultError();
+        }
+        if (x < 0) {
+            return DPQ.rd0(giveLog);
+        }
+
+        try {
+            DPQ.nonintCheck(x, giveLog); // incl warning
+        } catch (EarlyReturn e) {
+            return e.result;
+        }
+
+        x = RMath.forceint(x);
+        r = RMath.forceint(r);
+        b = RMath.forceint(b);
+        n = RMath.forceint(n);
+
+        if (n < x || r < x || n - x > b) {
+            return DPQ.rd0(giveLog);
+        }
+        if (n == 0) {
+            return (x == 0) ? DPQ.rd1(giveLog) : DPQ.rd0(giveLog);
+        }
+
+        double p = n / (r + b);
+        double q = (r + b - n) / (r + b);
+
+        double p1 = dbinomRaw(x, r, p, q, giveLog);
+        double p2 = dbinomRaw(n - x, b, p, q, giveLog);
+        double p3 = dbinomRaw(n, r + b, p, q, giveLog);
+
+        return (giveLog) ? p1 + p2 - p3 : p1 * p2 / p3;
+    }
+}
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DNBeta.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DNBeta.java
new file mode 100644
index 0000000000000000000000000000000000000000..2a6fe146eb926f9c48ad9c23d71add58310e4cb1
--- /dev/null
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DNBeta.java
@@ -0,0 +1,94 @@
+/*
+ * This material is distributed under the GNU General Public License
+ * Version 2. You may review the terms of this license at
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * Copyright (C) 1998 Ross Ihaka
+ * Copyright (c) 2000-12, The R Core Team
+ * Copyright (c) 2016, Oracle and/or its affiliates
+ *
+ * All rights reserved.
+ */
+package com.oracle.truffle.r.library.stats;
+
+import static com.oracle.truffle.r.library.stats.GammaFunctions.dpoisRaw;
+
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function4_1;
+
+public class DNBeta implements Function4_1 {
+    private static final double eps = 1.e-15;
+    private final DBeta dbeta = new DBeta();
+
+    @Override
+    public double evaluate(double x, double a, double b, double ncp, boolean giveLog) {
+        if (Double.isNaN(x) || Double.isNaN(a) || Double.isNaN(b) || Double.isNaN(ncp)) {
+            return x + a + b + ncp;
+        }
+        if (ncp < 0 || a <= 0 || b <= 0 || !Double.isFinite(a) || !Double.isFinite(b) || !Double.isFinite(ncp)) {
+            return RMathError.defaultError();
+        }
+
+        if (x < 0 || x > 1) {
+            return DPQ.rd0(giveLog);
+        }
+        if (ncp == 0) {
+            return dbeta.evaluate(x, a, b, giveLog);
+        }
+
+        /* New algorithm, starting with *largest* term : */
+        double ncp2 = 0.5 * ncp;
+        double dx2 = ncp2 * x;
+        double d = (dx2 - a - 1) / 2;
+        double capD = d * d + dx2 * (a + b) - a;
+        int kMax;
+        if (capD <= 0) {
+            kMax = 0;
+        } else {
+            capD = Math.ceil(d + Math.sqrt(capD));
+            kMax = (capD > 0) ? (int) capD : 0;
+        }
+
+        /* The starting "middle term" --- first look at it's log scale: */
+        double term = dbeta.evaluate(x, a + kMax, b, /* log = */ true);
+        /* LDOUBLE */double pK = dpoisRaw(kMax, ncp2, true);
+        if (x == 0. || !Double.isFinite(term) || !Double.isFinite(pK)) {
+            /* if term = +Inf */
+            return DPQ.rdexp(pK + term, giveLog);
+        }
+
+        /*
+         * Now if s_k := pK * t_k {here = Math.exp(pK + term)} would underflow, we should rather
+         * scale everything and re-scale at the end:
+         */
+
+        pK += term; /*
+                     * = Math.log(pK) + Math.log(t_k) == Math.log(s_k) -- used at end to rescale
+                     */
+        /* mid = 1 = the rescaled value, instead of mid = Math.exp(pK); */
+
+        /* Now sum from the inside out */
+        /* LDOUBLE */double sum = term = 1. /* = mid term */;
+        /* middle to the left */
+        int k = kMax;
+        while (k > 0 && term > sum * eps) {
+            k--;
+            /* LDOUBLE */double q = /* 1 / r_k = */ (k + 1) * (k + a) / (k + a + b) / dx2;
+            term *= q;
+            sum += term;
+        }
+        /* middle to the right */
+        term = 1.;
+        k = kMax;
+        do {
+            /* LDOUBLE */double q = /* r_{old k} = */ dx2 * (k + a + b) / (k + a) / (k + 1);
+            k++;
+            term *= q;
+            sum += term;
+        } while (term > sum * eps);
+
+        // #ifdef HAVE_LONG_DOUBLE
+        // return DPQ.rdMath.exp((double)(pK + logl(sum)));
+        // #else
+        return DPQ.rdexp(pK + Math.log(sum), giveLog);
+    }
+}
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DNChisq.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DNChisq.java
new file mode 100644
index 0000000000000000000000000000000000000000..55515c3247d87af6f3b93b66b58ba2675f713bb8
--- /dev/null
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DNChisq.java
@@ -0,0 +1,115 @@
+/*
+ * This material is distributed under the GNU General Public License
+ * Version 2. You may review the terms of this license at
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * Copyright (C) 1998 Ross Ihaka
+ * Copyright (c) 2000-15, The R Core Team
+ * Copyright (c) 2004-15, The R Foundation
+ * Copyright (c) 2016, Oracle and/or its affiliates
+ *
+ * All rights reserved.
+ */
+package com.oracle.truffle.r.library.stats;
+
+import static com.oracle.truffle.r.library.stats.GammaFunctions.dpoisRaw;
+
+import com.oracle.truffle.r.library.stats.Chisq.DChisq;
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function3_1;
+
+public class DNChisq implements Function3_1 {
+    private static final double eps = 5e-15;
+    private final DChisq dchisq = new DChisq();
+
+    @Override
+    public double evaluate(double x, double df, double ncp, boolean giveLog) {
+        if (Double.isNaN(x) || Double.isNaN(df) || Double.isNaN(ncp)) {
+            return x + df + ncp;
+        }
+
+        if (!Double.isFinite(df) || !Double.isFinite(ncp) || ncp < 0 || df < 0) {
+            return RMathError.defaultError();
+        }
+
+        if (x < 0) {
+            return DPQ.rd0(giveLog);
+        }
+        if (x == 0 && df < 2.) {
+            return Double.POSITIVE_INFINITY;
+        }
+        if (ncp == 0) {
+            return (df > 0) ? dchisq.evaluate(x, df, giveLog) : DPQ.rd0(giveLog);
+        }
+        if (x == Double.POSITIVE_INFINITY) {
+            return DPQ.rd0(giveLog);
+        }
+
+        double ncp2 = 0.5 * ncp;
+
+        /* find max element of sum */
+        double imax = Math.ceil((-(2 + df) + Math.sqrt((2 - df) * (2 - df) + 4 * ncp * x)) / 4);
+        double mid;
+        double dfmid = 0;   // Note: not initialized in GnuR
+        if (imax < 0) {
+            imax = 0;
+        }
+        if (Double.isFinite(imax)) {
+            dfmid = df + 2 * imax;
+            mid = dpoisRaw(imax, ncp2, false) * dchisq.evaluate(x, dfmid, false);
+        } else {
+            /* imax = Inf */
+            mid = 0;
+        }
+
+        if (mid == 0) {
+            /*
+             * underflow to 0 -- maybe numerically correct; maybe can be more accurate, particularly
+             * when giveLog = true
+             */
+            /*
+             * Use central-chisq approximation formula when appropriate; ((FIXME: the optimal cutoff
+             * also depends on (x,df); use always here? ))
+             */
+            if (giveLog || ncp > 1000.) {
+                /* = "1/(1+b)" Abramowitz & St. */
+                double nl = df + ncp;
+                double ic = nl / (nl + ncp);
+                return dchisq.evaluate(x * ic, nl * ic, giveLog);
+            } else {
+                return DPQ.rd0(giveLog);
+            }
+        }
+
+        /* errorbound := term * q / (1-q) now subsumed in while() / if () below: */
+
+        /* upper tail */
+        /* LDOUBLE */double sum = mid;
+        /* LDOUBLE */double term = mid;
+        df = dfmid;
+        double i = imax;
+        double x2 = x * ncp2;
+        double q;
+        do {
+            i++;
+            q = x2 / i / df;
+            df += 2;
+            term *= q;
+            sum += term;
+        } while (q >= 1 || term * q > (1 - q) * eps || term > 1e-10 * sum);
+        /* lower tail */
+        term = mid;
+        df = dfmid;
+        i = imax;
+        while (i != 0) {
+            df -= 2;
+            q = i * df / x2;
+            i--;
+            term *= q;
+            sum += term;
+            if (q < 1 && term * q <= (1 - q) * eps) {
+                break;
+            }
+        }
+        return DPQ.rdval(sum, giveLog);
+    }
+}
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DPQ.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DPQ.java
index 1d2abb3cff6cce02b5cefa761619a343bd61a4cb..2ec4f83eaa7441ee8cb89ea6752bfcf15bedcb0a 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DPQ.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DPQ.java
@@ -95,6 +95,11 @@ public final class DPQ {
         return logP ? Math.log(x) : x; /* x in pF(x,..) */
     }
 
+    // R_DT_val
+    public static double rdtval(double x, boolean lowerTail, boolean logP) {
+        return lowerTail ? rdval(x, true) : rdclog(x, logP);
+    }
+
     public static double rdexp(double x, boolean logP) {
         return logP ? x : Math.exp(x); /* exp(x) */
     }
@@ -138,6 +143,12 @@ public final class DPQ {
         return logP ? lowerTail ? -Math.expm1(p) : Math.exp(p) : rdcval(p, lowerTail);
     }
 
+    /* [neg]ative or [non int]eger : */
+    // R_D_negInonint
+    public static boolean rdneginonint(double x) {
+        return x < 0. || nonint(x);
+    }
+
     // R_Q_P01_boundaries
     public static void rqp01boundaries(double p, double left, double right, boolean lowerTail, boolean logP) throws EarlyReturn {
         if (logP) {
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Dnf.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Dnf.java
new file mode 100644
index 0000000000000000000000000000000000000000..4b4713273b341e906316620b62f057d411884ea9
--- /dev/null
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Dnf.java
@@ -0,0 +1,78 @@
+/*
+ * This material is distributed under the GNU General Public License
+ * Version 2. You may review the terms of this license at
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * Copyright (c) 2006, The R Core Team
+ * Copyright (c) 2016, Oracle and/or its affiliates
+ *
+ * All rights reserved.
+ */
+/*
+ *  AUTHOR
+ *    Peter Ruckdeschel, peter.ruckdeschel@uni-bayreuth.de.
+ *    April 13, 2006.
+ *
+ */
+package com.oracle.truffle.r.library.stats;
+
+import static com.oracle.truffle.r.library.stats.GammaFunctions.dgamma;
+
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function4_1;
+
+public class Dnf implements Function4_1 {
+    private final DNChisq dnchisq = new DNChisq();
+    private final DNBeta dnbeta = new DNBeta();
+
+    @Override
+    public double evaluate(double x, double df1, double df2, double ncp, boolean giveLog) {
+        if (Double.isNaN(x) || Double.isNaN(df1) || Double.isNaN(df2) || Double.isNaN(ncp)) {
+            return x + df2 + df1 + ncp;
+        }
+
+        /*
+         * want to compare dnf(ncp=0) behavior with df() one, hence *NOT* : if (ncp == 0) return
+         * df(x, df1, df2, giveLog);
+         */
+
+        if (df1 <= 0. || df2 <= 0. || ncp < 0) {
+            return RMathError.defaultError();
+        }
+        if (x < 0.) {
+            return DPQ.rd0(giveLog);
+        }
+        if (!Double.isFinite(ncp)) {
+            /* ncp = +Inf -- GnuR: fix me?: in some cases, limit exists */
+            return RMathError.defaultError();
+        }
+
+        /*
+         * This is not correct for df1 == 2, ncp > 0 - and seems unneeded: if (x == 0.) { return(df1
+         * > 2 ? DPQ.rd0(log_p) : (df1 == 2 ? DPQ.rd1 : Double.POSITIVE_INFINITY)); }
+         */
+        if (!Double.isFinite(df1) && !Double.isFinite(df2)) {
+            /* both +Inf */
+            /* PR: not sure about this (taken from ncp==0) -- GnuR fix me ? */
+            if (x == 1.) {
+                return Double.POSITIVE_INFINITY;
+            } else {
+                return DPQ.rd0(giveLog);
+            }
+        }
+        if (!Double.isFinite(df2)) {
+            /* i.e. = +Inf */
+            return df1 * dnchisq.evaluate(x * df1, df1, ncp, giveLog);
+        }
+        /* == dngamma(x, df1/2, 2./df1, ncp, giveLog) -- but that does not exist */
+        if (df1 > 1e14 && ncp < 1e7) {
+            /* includes df1 == +Inf: code below is inaccurate there */
+            double f = 1 + ncp / df1; /* assumes ncp << df1 [ignores 2*ncp^(1/2)/df1*x term] */
+            double z = dgamma(1. / x / f, df2 / 2, 2. / df2, giveLog);
+            return giveLog ? z - 2 * Math.log(x) - Math.log(f) : z / (x * x) / f;
+        }
+
+        double y = (df1 / df2) * x;
+        double z = dnbeta.evaluate(y / (1 + y), df1 / 2., df2 / 2., ncp, giveLog);
+        return giveLog ? z + Math.log(df1) - Math.log(df2) - 2 * RMath.log1p(y) : z * (df1 / df2) / (1 + y) / (1 + y);
+    }
+}
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/GammaFunctions.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/GammaFunctions.java
index a4c8919161dc0f5710ab2c3850d66b2a044ffb14..18c55e3ee9f79d79a4ee41c400b4f66f9d635988 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/GammaFunctions.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/GammaFunctions.java
@@ -38,10 +38,12 @@ import static com.oracle.truffle.r.library.stats.RMath.fmax2;
 import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
 import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
 import com.oracle.truffle.r.library.stats.DPQ.EarlyReturn;
+import com.oracle.truffle.r.library.stats.RMathError.MLError;
 import com.oracle.truffle.r.library.stats.StatsFunctions.Function3_1;
 import com.oracle.truffle.r.library.stats.StatsFunctions.Function3_2;
-import com.oracle.truffle.r.runtime.RError;
+import com.oracle.truffle.r.runtime.RError.Message;
 import com.oracle.truffle.r.runtime.RRuntime;
+import com.oracle.truffle.r.runtime.Utils;
 import com.oracle.truffle.r.runtime.ops.BinaryArithmetic;
 
 /**
@@ -179,8 +181,8 @@ public abstract class GammaFunctions {
             // TODO ML_ERR_return_NAN
             return Double.NaN;
         } else if (x >= lgc_xmax) {
-            // ML_ERROR(ME_UNDERFLOW, "lgammacor");
             /* allow to underflow below */
+            RMathError.error(MLError.UNDERFLOW, "lgammacor");
         } else if (x < xbig) {
             tmp = 10 / x;
             return RMath.chebyshevEval(tmp * tmp * 2 - 1, ALGMCS, nalgm) / x;
@@ -188,8 +190,12 @@ public abstract class GammaFunctions {
         return 1 / (x * 12);
     }
 
+    /**
+     * Should be used in places where GnuR itself uses std libc function {@code lgamma}. Under the
+     * hood it uses {@link #lgammafn(double)}.
+     */
     static double lgamma(@SuppressWarnings("unused") double x) {
-        throw RError.nyi(RError.SHOW_CALLER, "lgamma from libc");
+        return lgammafn(x);
     }
 
     //
@@ -267,7 +273,7 @@ public abstract class GammaFunctions {
                 /* The answer is less than half precision */
                 /* because x too near a negative integer. */
                 if (x < -0.5 && Math.abs(x - (int) (x - 0.5) / x) < gfn_dxrel) {
-                    // ML_ERROR(ME_PRECISION, "gammafn");
+                    RMathError.error(MLError.PRECISION, "gammafn");
                 }
 
                 /* The argument is so close to 0 that the result would overflow. */
@@ -320,16 +326,14 @@ public abstract class GammaFunctions {
             }
 
             if (Math.abs((x - (int) (x - 0.5)) / x) < gfn_dxrel) {
-
                 /* The answer is less than half precision because */
                 /* the argument is too near a negative integer. */
-
-                // ML_ERROR(ME_PRECISION, "gammafn");
+                RMathError.error(MLError.PRECISION, "gammafn");
             }
 
             sinpiy = Math.sin(Math.PI * y);
             if (sinpiy == 0) { /* Negative integer arg - overflow */
-                // ML_ERROR(ME_RANGE, "gammafn");
+                RMathError.error(MLError.RANGE, "gammafn");
                 return Double.POSITIVE_INFINITY;
             }
 
@@ -372,7 +376,7 @@ public abstract class GammaFunctions {
         }
 
         if (x <= 0 && x == (long) x) { /* Negative integer argument */
-            RError.warning(RError.SHOW_CALLER, RError.Message.VALUE_OUT_OF_RANGE, "lgamma");
+            RMathError.error(MLError.RANGE, "lgamma");
             return Double.POSITIVE_INFINITY; /* +Inf, since lgamma(x) = log|gamma(x)| */
         }
 
@@ -389,7 +393,7 @@ public abstract class GammaFunctions {
          */
 
         if (y > gfn_sign_xmax) {
-            RError.warning(RError.SHOW_CALLER, RError.Message.VALUE_OUT_OF_RANGE, "lgamma");
+            RMathError.error(MLError.RANGE, "lgamma");
             return Double.POSITIVE_INFINITY;
         }
 
@@ -408,21 +412,18 @@ public abstract class GammaFunctions {
         if (sinpiy == 0) { /*
                             * Negative integer argument === Now UNNECESSARY: caught above
                             */
-            // MATHLIB_WARNING(" ** should NEVER happen! *** [lgamma.c: Neg.int, y=%g]\n",y);
-            // TODO ML_ERR_return_NAN;
-            return Double.NaN;
+            RMathError.warning(Message.GENERIC, " ** should NEVER happen! *** [lgamma.c: Neg.int]");
+            return RMathError.defaultError();
         }
 
         ans = M_LN_SQRT_PId2 + (x - 0.5) * Math.log(y) - x - Math.log(sinpiy) - lgammacor(y);
 
         if (Math.abs((x - (long) (x - 0.5)) * ans / x) < gfn_sign_dxrel) {
-
             /*
              * The answer is less than half precision because the argument is too near a negative
              * integer.
              */
-
-            RError.warning(RError.SHOW_CALLER2, RError.Message.FULL_PRECISION, "lgamma");
+            RMathError.error(MLError.PRECISION, "lgamma");
         }
 
         return ans;
@@ -465,8 +466,7 @@ public abstract class GammaFunctions {
         }
 
         if (nu <= 0) {
-            // TODO ML_ERR_return_NAN;
-            return Double.NaN;
+            return RMathError.defaultError();
         }
 
         alpha = 0.5 * nu; /* = [pq]gamma() shape */
@@ -550,8 +550,7 @@ public abstract class GammaFunctions {
         // expansion of R_Q_P01_boundaries(p, 0., ML_POSINF)
         if (localLogp) {
             if (localP > 0) {
-                // TODO ML_ERR_return_NAN;
-                return Double.NaN;
+                return RMathError.defaultError();
             }
             if (localP == 0) { /* upper bound */
                 return lowerTail ? Double.POSITIVE_INFINITY : 0;
@@ -561,8 +560,7 @@ public abstract class GammaFunctions {
             }
         } else { /* !log_p */
             if (localP < 0 || localP > 1) {
-                // TODO ML_ERR_return_NAN;
-                return Double.NaN;
+                return RMathError.defaultError();
             }
             if (localP == 0) {
                 return lowerTail ? 0 : Double.POSITIVE_INFINITY;
@@ -573,8 +571,7 @@ public abstract class GammaFunctions {
         }
 
         if (alpha < 0 || scale <= 0) {
-            // TODO ML_ERR_return_NAN;
-            return Double.NaN;
+            return RMathError.defaultError();
         }
 
         if (alpha == 0) {
@@ -1011,7 +1008,7 @@ public abstract class GammaFunctions {
             }
         }
 
-        // MATHLIB_WARNING(" ** NON-convergence in pgamma()'s pd_lower_cf() f= %g.\n", f);
+        RMathError.warning(Message.GENERIC, Utils.stringFormat(" ** NON-convergence in pgamma()'s pd_lower_cf() f= %g.", f));
         return f; /* should not happen ... */
     } /* pd_lower_cf() */
 
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/MathConstants.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/MathConstants.java
index f853238a5a1121c4831831c277500770795d19d2..d7c4b92c6220ba622018eb086fa0db0d3763d38b 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/MathConstants.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/MathConstants.java
@@ -88,8 +88,12 @@ public final class MathConstants {
 
     public static final double ML_NAN = Double.NaN;
 
-    // Different to Double.MIN_VALUE...
-    public static final double DBL_MIN = 2.2250738585072014e-308;
+    // Different to Double.MIN_VALUE!
+    public static final double DBL_MIN = Double.MIN_NORMAL;
+
+    public static final double DBL_MAX = Double.MAX_VALUE;
+
+    static final double INV_SQRT_2_PI = .398942280401433; /* == 1/sqrt(2*pi); */
 
     /**
      * Compute the log of a sum from logs of terms, i.e.,
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PHyper.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PHyper.java
new file mode 100644
index 0000000000000000000000000000000000000000..5a52dd603231eb1033985c12898d9d46d25b43fe
--- /dev/null
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PHyper.java
@@ -0,0 +1,93 @@
+/*
+ * This material is distributed under the GNU General Public License
+ * Version 2. You may review the terms of this license at
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * Copyright (C) 1998 Ross Ihaka
+ * Copyright (c) 1999-2014, The R Core Team
+ * Copyright (c) 2004, The R Foundation
+ * Copyright (c) 2016, Oracle and/or its affiliates
+ *
+ * All rights reserved.
+ */
+/*
+ * Copyright (C) 2004 Morten Welinder
+ *
+ * Current implementation based on posting
+ * From: Morten Welinder <terra@gnome.org>
+ * Cc: R-bugs@biostat.ku.dk
+ * Subject: [Rd] phyper accuracy and efficiency (PR#6772)
+ * Date: Thu, 15 Apr 2004 18:06:37 +0200 (CEST)
+ */
+package com.oracle.truffle.r.library.stats;
+
+import static com.oracle.truffle.r.library.stats.MathConstants.DBL_EPSILON;
+
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function4_2;
+
+public final class PHyper implements Function4_2 {
+    private final DHyper dhyper = new DHyper();
+
+    @Override
+    public double evaluate(double x, double nr, double nb, double n, boolean lowerTail, boolean logP) {
+        /* Sample of n balls from nr red and nb black ones; x are red */
+        if (Double.isNaN(x) || Double.isNaN(nr) || Double.isNaN(nb) || Double.isNaN(n)) {
+            return x + nr + nb + n;
+        }
+
+        x = Math.floor(x + 1e-7);
+        nr = RMath.forceint(nr);
+        nb = RMath.forceint(nb);
+        n = RMath.forceint(n);
+
+        if (nr < 0 || nb < 0 || !Double.isFinite(nr + nb) || n < 0 || n > nr + nb) {
+            return RMathError.defaultError();
+        }
+
+        if (x * (nr + nb) > n * nr) {
+            /* Swap tails. */
+            double oldNB = nb;
+            nb = nr;
+            nr = oldNB;
+            x = n - x - 1;
+            lowerTail = !lowerTail;
+        }
+
+        if (x < 0) {
+            return DPQ.rdt0(lowerTail, logP);
+        }
+        if (x >= nr || x >= n) {
+            return DPQ.rdt1(lowerTail, logP);
+        }
+
+        double d = dhyper.evaluate(x, nr, nb, n, logP);
+        double pd = pdhyper(x, nr, nb, n, logP);
+
+        return logP ? DPQ.rdtlog(d + pd, lowerTail, logP) : DPQ.rdlval(d * pd, lowerTail);
+    }
+
+    static double pdhyper(double x, double nr, double nb, double n, boolean logP) {
+        /*
+         * Calculate
+         *
+         * phyper (x, nr, nb, n, true, false) [log] ---------------------------------- dhyper (x,
+         * nr, nb, n, false)
+         *
+         * without actually calling phyper. This assumes that
+         *
+         * x * (nr + nb) <= n * nr
+         *
+         */
+        /* LDOUBLE */double sum = 0;
+        /* LDOUBLE */double term = 1;
+
+        while (x > 0 && term >= DBL_EPSILON * sum) {
+            term *= x * (nb - n + x) / (n + 1 - x) / (nr + 1 - x);
+            sum += term;
+            x--;
+        }
+
+        double ss = sum;
+        return logP ? RMath.log1p(ss) : 1 + ss;
+    }
+}
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PNBeta.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PNBeta.java
new file mode 100644
index 0000000000000000000000000000000000000000..7734338fc8bb15fc79e2ee565225937defd79f91
--- /dev/null
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PNBeta.java
@@ -0,0 +1,126 @@
+/*
+ * This material is distributed under the GNU General Public License
+ * Version 2. You may review the terms of this license at
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * Copyright (c) 2000-2013, The R Core Team
+ * Copyright (c) 2016, Oracle and/or its affiliates
+ *
+ * All rights reserved.
+ */
+package com.oracle.truffle.r.library.stats;
+
+import static com.oracle.truffle.r.library.stats.GammaFunctions.lgammafn;
+
+import com.oracle.truffle.r.library.stats.DPQ.EarlyReturn;
+import com.oracle.truffle.r.library.stats.RMathError.MLError;
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function4_2;
+import com.oracle.truffle.r.library.stats.TOMS708.Bratio;
+
+public class PNBeta implements Function4_2 {
+    @Override
+    public double evaluate(double x, double a, double b, double ncp, boolean lowerTail, boolean logP) {
+        if (Double.isNaN(x) || Double.isNaN(a) || Double.isNaN(b) || Double.isNaN(ncp)) {
+            return x + a + b + ncp;
+        }
+        try {
+            DPQ.rpbounds01(x, 0., 1., lowerTail, logP);
+        } catch (EarlyReturn e) {
+            return e.result;
+        }
+        return pnbeta2(x, 1 - x, a, b, ncp, lowerTail, logP);
+    }
+
+    double pnbeta2(double x, double oX, double a, double b, double ncp, boolean lowerTail, boolean logP) {
+        /* LDOUBLE */
+        double ans = pnbetaRaw(x, oX, a, b, ncp);
+
+        /* return DPQ.rdtval(ans), but we want to warn about cancellation here */
+        if (lowerTail) {
+            // #ifdef HAVE_LONG_DOUBLE
+            // return (double) (logP ? logl(ans) : ans);
+            // #else
+            return logP ? Math.log(ans) : ans;
+        } else {
+            if (ans > 1. - 1e-10) {
+                RMathError.error(MLError.PRECISION, "pnbeta");
+            }
+            if (ans > 1.0) {
+                ans = 1.0;
+            } /* Precaution */
+            // #if defined(HAVE_LONG_DOUBLE) && defined(HAVE_LOG1PL)
+            // return (double) (logP ? log1pl(-ans) : (1. - ans));
+            // #else
+            /* include standalone case */
+            return (logP ? RMath.log1p(-ans) : (1. - ans));
+        }
+
+    }
+
+    /*
+     * GnuR: change errmax and itrmax if desired; original (AS 226, R84) had (errmax; itrmax) =
+     * (1e-6; 100)
+     */
+    private static final double errmax = 1.0e-9;
+    private static final int itrmax = 10000; /*
+                                              * GnuR: 100 is not enough for pf(ncp=200) see PR#11277
+                                              */
+
+    double pnbetaRaw(double x, double oX, double a, double b, double ncp) {
+        /* oX == 1 - x but maybe more accurate */
+        if (ncp < 0. || a <= 0. || b <= 0.) {
+            return RMathError.defaultError();
+        }
+
+        if (x < 0. || oX > 1. || (x == 0. && oX == 1.)) {
+            return 0.;
+        }
+        if (x > 1. || oX < 0. || (x == 1. && oX == 0.)) {
+            return 1.;
+        }
+
+        double c = ncp / 2.;
+
+        /* initialize the series */
+        double x0 = Math.floor(RMath.fmax2(c - 7. * Math.sqrt(c), 0.));
+        double a0 = a + x0;
+        double lbeta = lgammafn(a0) + lgammafn(b) - lgammafn(a0 + b);
+
+        /* temp = pbeta_raw(x, a0, b, true, false), but using (x, oX): */
+        double temp = Bratio.bratio(a0, b, x, oX, false).w;
+
+        /* LDOUBLE */double gx = Math.exp(a0 * Math.log(x) + b * (x < .5 ? RMath.log1p(-x) : Math.log(oX)) - lbeta - Math.log(a0));
+        /* LDOUBLE */double q;
+        if (a0 > a) {
+            q = Math.exp(-c + x0 * Math.log(c) - lgammafn(x0 + 1.));
+        } else {
+            q = Math.exp(-c);
+        }
+
+        /* LDOUBLE */double sumq = 1. - q;
+        /* LDOUBLE */double ans = q * temp;
+        /* LDOUBLE */double ax = ans;
+
+        /* recurse over subsequent terms until convergence is achieved */
+        double j = Math.floor(x0); // x0 could be billions, and is in package EnvStats
+        double errbd;
+        do {
+            j++;
+            temp -= gx;
+            gx *= x * (a + b + j - 1.) / (a + j);
+            q *= c / j;
+            sumq -= q;
+            ax = temp * q;
+            ans += ax;
+            errbd = ((temp - gx) * sumq);
+        } while (errbd > errmax && j < itrmax + x0);
+
+        if (errbd > errmax) {
+            RMathError.error(MLError.PRECISION, "pnbeta");
+        }
+        if (j >= itrmax + x0) {
+            RMathError.error(MLError.NOCONV, "pnbeta");
+        }
+        return ans;
+    }
+}
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PNChisq.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PNChisq.java
new file mode 100644
index 0000000000000000000000000000000000000000..561fd2740d8b730871432f8ce1fa6706ebd45234
--- /dev/null
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PNChisq.java
@@ -0,0 +1,307 @@
+/*
+ * This material is distributed under the GNU General Public License
+ * Version 2. You may review the terms of this license at
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * Copyright (c) 2000-2015, The R Core Team
+ * Copyright (c) 2003-2015, The R Foundation
+ * Copyright (c) 2016, Oracle and/or its affiliates
+ *
+ * All rights reserved.
+ */
+/*
+ *  Algorithm AS 275 Appl.Statist. (1992), vol.41, no.2
+ *  original  (C) 1992       Royal Statistical Society
+ *
+ *  Computes the noncentral chi-squared distribution function with
+ *  positive real degrees of freedom df and nonnegative noncentrality
+ *  parameter ncp.  pnchisq_raw is based on
+ *
+ *    Ding, C. G. (1992)
+ *    Algorithm AS275: Computing the non-central chi-squared
+ *    distribution function. Appl.Statist., 41, 478-482.
+ */
+
+package com.oracle.truffle.r.library.stats;
+
+import static com.oracle.truffle.r.library.stats.GammaFunctions.lgamma;
+import static com.oracle.truffle.r.library.stats.GammaFunctions.lgammafn;
+import static com.oracle.truffle.r.library.stats.MathConstants.DBL_EPSILON;
+import static com.oracle.truffle.r.library.stats.MathConstants.DBL_MIN_EXP;
+import static com.oracle.truffle.r.library.stats.MathConstants.M_LN10;
+import static com.oracle.truffle.r.library.stats.MathConstants.M_LN2;
+import static com.oracle.truffle.r.library.stats.MathConstants.M_LN_SQRT_2PI;
+import static com.oracle.truffle.r.library.stats.MathConstants.logspaceAdd;
+
+import com.oracle.truffle.r.library.stats.Chisq.PChisq;
+import com.oracle.truffle.r.library.stats.RMathError.MLError;
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function3_2;
+import com.oracle.truffle.r.runtime.RError.Message;
+
+public class PNChisq implements Function3_2 {
+    private static final double _dbl_min_exp = M_LN2 * DBL_MIN_EXP;
+    private final PChisq pchisq = new PChisq();
+
+    @Override
+    public double evaluate(double x, double df, double ncp, boolean lowerTail, boolean logP) {
+        double ans;
+        if (Double.isNaN(x) || Double.isNaN(df) || Double.isNaN(ncp)) {
+            return x + df + ncp;
+        }
+        if (!Double.isFinite(df) || !Double.isFinite(ncp)) {
+            return RMathError.defaultError();
+        }
+
+        if (df < 0. || ncp < 0.) {
+            return RMathError.defaultError();
+        }
+
+        ans = pnchisqRaw(x, df, ncp, 1e-12, 8 * DBL_EPSILON, 1000000, lowerTail, logP);
+        if (ncp >= 80) {
+            if (lowerTail) {
+                ans = RMath.fmin2(ans, DPQ.rd1(logP)); /* e.g., pchisq(555, 1.01, ncp = 80) */
+            } else { /* !lower_tail */
+                /* since we computed the other tail cancellation is likely */
+                if (ans < (logP ? (-10. * M_LN10) : 1e-10)) {
+                    RMathError.error(MLError.PRECISION, "pnchisq");
+                }
+                if (!logP) {
+                    ans = RMath.fmax2(ans, 0.0);
+                } /* Precaution PR#7099 */
+            }
+        }
+        if (!logP || ans < -1e-8) {
+            return ans;
+        } else { // log_p && ans > -1e-8
+            // prob. = Math.exp(ans) is near one: we can do better using the other tail
+            debugPrintf("   pnchisq_raw(*, log_p): ans=%g => 2nd call, other tail\n", ans);
+            // GNUR fix me: (sum,sum2) will be the same (=> return them as well and reuse here ?)
+            ans = pnchisqRaw(x, df, ncp, 1e-12, 8 * DBL_EPSILON, 1000000, !lowerTail, false);
+            return RMath.log1p(-ans);
+        }
+    }
+
+    double pnchisqRaw(double x, double f, double theta /* = ncp */,
+                    double errmax, double reltol, int itrmax,
+                    boolean lowerTail, boolean logP) {
+        if (x <= 0.) {
+            if (x == 0. && f == 0.) {
+                final double minusLambda = (-0.5 * theta);
+                return lowerTail ? DPQ.rdexp(minusLambda, logP) : (logP ? DPQ.rlog1exp(minusLambda) : -RMath.expm1(minusLambda));
+            }
+            /* x < 0 or {x==0, f > 0} */
+            return DPQ.rdt0(lowerTail, logP);
+        }
+        if (!Double.isFinite(x)) {
+            return DPQ.rdt1(lowerTail, logP);
+        }
+
+        if (theta < 80) {
+            /* use 110 for Inf, as ppois(110, 80/2, lower.tail=false) is 2e-20 */
+            return smallTheta(x, f, theta, lowerTail, logP);
+        }
+
+        // else: theta == ncp >= 80 --------------------------------------------
+        debugPrintf("pnchisq(x=%g, f=%g, theta=%g >= 80): ", x, f, theta);
+
+        // Series expansion ------- FIXME: log_p=true, lower_tail=false only applied at end
+
+        double lam = .5 * theta;
+        boolean lamSml = (-lam < _dbl_min_exp);
+        double lLam = -1;
+        /* LDOUBLE */double lu = -1;
+        /* LDOUBLE */double u;
+        if (lamSml) {
+            u = 0;
+            lu = -lam; /* == ln(u) */
+            lLam = Math.log(lam);
+        } else {
+            u = Math.exp(-lam);
+        }
+
+        /* evaluate the first term */
+        /* LDOUBLE */double v = u;
+        double x2 = .5 * x;
+        double f2 = .5 * f;
+        double fx2n = f - x;
+
+        debugPrintf("-- v=Math.exp(-th/2)=%g, x/2= %g, f/2= %g\n", v, x2, f2);
+
+        /* LDOUBLE */double lt;
+        /* LDOUBLE */double t;
+        if (f2 * DBL_EPSILON > 0.125 && /* very large f and x ~= f: probably needs */
+                        MathWrapper.abs(t = x2 - f2) < /* another algorithm anyway */
+                        Math.sqrt(DBL_EPSILON) * f2) {
+            /* evade cancellation error */
+            /* t = Math.exp((1 - t)*(2 - t/(f2 + 1))) / Math.sqrt(2*M_PI*(f2 + 1)); */
+            lt = (1 - t) * (2 - t / (f2 + 1)) - M_LN_SQRT_2PI - 0.5 * Math.log(f2 + 1);
+            debugPrintf(" (case I) ==> ");
+        } else {
+            /* Usual case 2: careful not to overflow .. : */
+            lt = f2 * Math.log(x2) - x2 - lgammafn(f2 + 1);
+        }
+        debugPrintf(" lt= %g", lt);
+
+        boolean tSml = (lt < _dbl_min_exp);
+        double lX = -1;
+        double term;
+        /* LDOUBLE */double ans;
+        if (tSml) {
+            debugPrintf(" is very small\n");
+            if (x > f + theta + 5 * Math.sqrt(2 * (f + 2 * theta))) {
+                /* x > E[X] + 5* sigma(X) */
+                return DPQ.rdt1(lowerTail, logP); /*
+                                                   * GNUR fix me: could be more accurate than 0.
+                                                   */
+            } /* else */
+            lX = Math.log(x);
+            ans = term = 0.;
+            t = 0;
+        } else {
+            t = MathWrapper.exp(lt);
+            debugPrintf(", t=Math.exp(lt)= %g\n", t);
+            ans = term = (v * t);
+        }
+
+        int n;
+        double f2n;
+        boolean isIt;
+        double bound;
+        for (n = 1, f2n = f + 2., fx2n += 2.;; n++, f2n += 2, fx2n += 2) {
+            debugPrintf("\n _OL_: n=%d", n);
+            /*
+             * f2n === f + 2*n fx2n === f - x + 2*n > 0 <==> (f+2n) > x
+             */
+            if (fx2n > 0) {
+                /* find the error bound and check for convergence */
+                bound = t * x / fx2n;
+                debugPrintf("\n L10: n=%d; term= %g; bound= %g", n, term, bound);
+                boolean isR = isIt = false;
+                boolean isB;
+                /* convergence only if BOTH absolute and relative error < 'bnd' */
+                if (((isB = (bound <= errmax)) &&
+                                (isR = (term <= reltol * ans))) || (isIt = (n > itrmax))) {
+                    debugPrintf("BREAK n=%d %s; bound= %g %s, rel.err= %g %s\n",
+                                    n, (isIt ? "> itrmax" : ""),
+                                    bound, (isB ? "<= errmax" : ""),
+                                    term / ans, (isR ? "<= reltol" : ""));
+                    break; /* out completely */
+                }
+
+            }
+
+            /* evaluate the next term of the */
+            /* expansion and then the partial sum */
+
+            if (lamSml) {
+                lu += lLam - Math.log(n); /* u = u* lam / n */
+                if (lu >= _dbl_min_exp) {
+                    /* no underflow anymore ==> change regime */
+                    debugPrintf(" n=%d; nomore underflow in u = Math.exp(lu) ==> change\n",
+                                    n);
+                    v = u = MathWrapper.exp(lu); /* the first non-0 'u' */
+                    lamSml = false;
+                }
+            } else {
+                u *= lam / n;
+                v += u;
+            }
+            if (tSml) {
+                lt += lX - Math.log(f2n); /* t <- t * (x / f2n) */
+                if (lt >= _dbl_min_exp) {
+                    /* no underflow anymore ==> change regime */
+                    debugPrintf("  n=%d; nomore underflow in t = Math.exp(lt) ==> change\n", n);
+                    t = MathWrapper.exp(lt); /* the first non-0 't' */
+                    tSml = false;
+                }
+            } else {
+                t *= x / f2n;
+            }
+            if (!lamSml && !tSml) {
+                term = v * t;
+                ans += term;
+            }
+
+        } /* for(n ...) */
+
+        if (isIt) {
+            RMathError.warning(Message.PCHISQ_NOT_CONVERGED_WARNING, x, itrmax);
+        }
+
+        debugPrintf("\n == L_End: n=%d; term= %g; bound=%g\n", n, term, bound);
+        return DPQ.rdtval(ans, lowerTail, logP);
+    }
+
+    private double smallTheta(double x, double f, double theta, boolean lowerTail, boolean logP) {
+        // Have pgamma(x,s) < x^s / Gamma(s+1) (< and ~= for small x)
+        // ==> pchisq(x, f) = pgamma(x, f/2, 2) = pgamma(x/2, f/2)
+        // < (x/2)^(f/2) / Gamma(f/2+1) < eps
+        // <==> f/2 * Math.log(x/2) - Math.log(Gamma(f/2+1)) < Math.log(eps) ( ~= -708.3964 )
+        // <==> Math.log(x/2) < 2/f*(Math.log(Gamma(f/2+1)) + Math.log(eps))
+        // <==> Math.log(x) < Math.log(2) + 2/f*(Math.log(Gamma(f/2+1)) + Math.log(eps))
+        if (lowerTail && f > 0. && Math.log(x) < M_LN2 + 2 / f * (lgamma(f / 2. + 1) + _dbl_min_exp)) {
+            // all pchisq(x, f+2*i, lower_tail, false), i=0,...,110 would underflow to 0.
+            // ==> work in log scale
+            double lambda = 0.5 * theta;
+            double sum;
+            double sum2;
+            double pr = -lambda;
+            sum = sum2 = Double.NEGATIVE_INFINITY;
+            /* we need to renormalize here: the result could be very close to 1 */
+            int i;
+            for (i = 0; i < 110; pr += Math.log(lambda) - Math.log(++i)) {
+                sum2 = logspaceAdd(sum2, pr);
+                sum = logspaceAdd(sum, pr + pchisq.evaluate(x, f + 2 * i, lowerTail, true));
+                if (sum2 >= -1e-15) {
+                    /* <=> EXP(sum2) >= 1-1e-15 */ break;
+                }
+            }
+            /* LDOUBLE */double ans = sum - sum2;
+            debugPrintf("pnchisq(x=%g, f=%g, th.=%g); th. < 80, logspace: i=%d, ans=(sum=%g)-(sum2=%g)\n",
+                            x, f, theta, i, sum, sum2);
+            return logP ? ans : MathWrapper.exp(ans);
+        } else {
+            /* LDOUBLE */double lambda = 0.5 * theta;
+            /* LDOUBLE */double sum = 0;
+            /* LDOUBLE */double sum2 = 0;
+            /* LDOUBLE */double pr = Math.exp(-lambda); // does this need a feature test?
+            /* we need to renormalize here: the result could be very close to 1 */
+            int i;
+            for (i = 0; i < 110; pr *= lambda / ++i) {
+                // pr == Math.exp(-lambda) lambda^i / i! == dpois(i, lambda)
+                sum2 += pr;
+                // pchisq(*, i, *) is strictly decreasing to 0 for lower_tail=true
+                // and strictly increasing to 1 for lower_tail=false
+                sum += pr * pchisq.evaluate(x, f + 2 * i, lowerTail, false);
+                if (sum2 >= 1 - 1e-15) {
+                    break;
+                }
+            }
+            /* LDOUBLE */double ans = sum / sum2;
+            debugPrintf("pnchisq(x=%g, f=%g, theta=%g); theta < 80: i=%d, sum=%g, sum2=%g\n",
+                            x, f, theta, i, sum, sum2);
+            return logP ? MathWrapper.log(ans) : ans;
+        }
+    }
+
+    private void debugPrintf(@SuppressWarnings("unused") String fmt, @SuppressWarnings("unused") Object... args) {
+        // System.out.printf(fmt + "\n", args);
+    }
+
+    /**
+     * For easier switch to {@code Decimal} if necessary.
+     */
+    private static final class MathWrapper {
+        public static double exp(double x) {
+            return Math.exp(x);
+        }
+
+        public static double log(double x) {
+            return Math.log(x);
+        }
+
+        public static double abs(double x) {
+            return Math.abs(x);
+        }
+    }
+}
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Pnf.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Pnf.java
new file mode 100644
index 0000000000000000000000000000000000000000..56ff4406e9a194b3fd901926ce30bf814d414e11
--- /dev/null
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Pnf.java
@@ -0,0 +1,54 @@
+/*
+ * This material is distributed under the GNU General Public License
+ * Version 2. You may review the terms of this license at
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * Copyright (C) 1998 Ross Ihaka
+ * Copyright (c) 2000-2008, The R Core Team
+ * Copyright (c) 2016, Oracle and/or its affiliates
+ *
+ * All rights reserved.
+ */
+package com.oracle.truffle.r.library.stats;
+
+import com.oracle.truffle.r.library.stats.DPQ.EarlyReturn;
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function4_2;
+
+public class Pnf implements Function4_2 {
+    private final PNChisq pnchisq = new PNChisq();
+    private final PNBeta pnbeta = new PNBeta();
+
+    @Override
+    public double evaluate(double x, double df1, double df2, double ncp, boolean lowerTail, boolean logP) {
+        double y;
+        if (Double.isNaN(x) || Double.isNaN(df1) || Double.isNaN(df2) || Double.isNaN(ncp)) {
+            return x + df2 + df1 + ncp;
+        }
+        if (df1 <= 0. || df2 <= 0. || ncp < 0) {
+            return RMathError.defaultError();
+        }
+        if (!Double.isFinite(ncp)) {
+
+            return RMathError.defaultError();
+        }
+        if (!Double.isFinite(df1) && !Double.isFinite(df2)) {
+            /* both +Inf */
+            return RMathError.defaultError();
+        }
+
+        try {
+            DPQ.rpbounds01(x, 0., Double.POSITIVE_INFINITY, lowerTail, logP);
+        } catch (EarlyReturn e) {
+            return e.result;
+        }
+
+        if (df2 > 1e8) {
+            /* avoid problems with +Inf and loss of accuracy */
+            return pnchisq.evaluate(x * df1, df1, ncp, lowerTail, logP);
+        }
+
+        y = (df1 / df2) * x;
+        return pnbeta.pnbeta2(y / (1. + y), 1. / (1. + y), df1 / 2., df2 / 2.,
+                        ncp, lowerTail, logP);
+    }
+}
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QHyper.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QHyper.java
index b9bcbaca28baab41d7680b2fa666ba7d062a472c..727442b4a6e71be54ee08d0e1b37691163aa4d0a 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QHyper.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QHyper.java
@@ -18,8 +18,14 @@ import static com.oracle.truffle.r.library.stats.RMath.forceint;
 import static com.oracle.truffle.r.library.stats.RMath.lfastchoose;
 
 import com.oracle.truffle.r.library.stats.DPQ.EarlyReturn;
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function4_2;
+
+public final class QHyper implements Function4_2 {
+    @Override
+    public double evaluate(double p, double nr, double nb, double n, boolean lowerTail, boolean logP) {
+        return qhyper(p, nr, nb, n, lowerTail, logP);
+    }
 
-public final class QHyper {
     public static double qhyper(double pIn, double nrIn, double nbIn, double nIn, boolean lowerTail, boolean logP) {
         /* This is basically the same code as ./phyper.c *used* to be --> FIXME! */
         if (Double.isNaN(pIn) || Double.isNaN(nrIn) || Double.isNaN(nbIn) || Double.isNaN(nIn)) {
@@ -87,5 +93,4 @@ public final class QHyper {
         }
         return xr;
     }
-
 }
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QNBeta.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QNBeta.java
new file mode 100644
index 0000000000000000000000000000000000000000..ea00bc27cf0cd1b62cd7f87db5e6e7439f7263e1
--- /dev/null
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QNBeta.java
@@ -0,0 +1,76 @@
+/*
+ * This material is distributed under the GNU General Public License
+ * Version 2. You may review the terms of this license at
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * Copyright (c) 2006, The R Core Team
+ * Copyright (c) 2016, Oracle and/or its affiliates
+ *
+ * All rights reserved.
+ */
+package com.oracle.truffle.r.library.stats;
+
+import static com.oracle.truffle.r.library.stats.MathConstants.DBL_EPSILON;
+import static com.oracle.truffle.r.library.stats.MathConstants.DBL_MIN;
+
+import com.oracle.truffle.r.library.stats.DPQ.EarlyReturn;
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function4_2;
+
+public class QNBeta implements Function4_2 {
+    private static final double accu = 1e-15;
+    private static final double Eps = 1e-14; /* must be > accu */
+
+    private final PNBeta pnbeta = new PNBeta();
+
+    @Override
+    public double evaluate(double p, double a, double b, double ncp, boolean lowerTail, boolean logP) {
+        if (Double.isNaN(p) || Double.isNaN(a) || Double.isNaN(b) || Double.isNaN(ncp)) {
+            return p + a + b + ncp;
+        }
+        if (!Double.isFinite(a)) {
+            return RMathError.defaultError();
+        }
+
+        if (ncp < 0. || a <= 0. || b <= 0.) {
+            return RMathError.defaultError();
+        }
+
+        try {
+            DPQ.rqp01boundaries(p, 0, 1, lowerTail, logP);
+        } catch (EarlyReturn e) {
+            return e.result;
+        }
+
+        p = DPQ.rdtqiv(p, lowerTail, logP);
+
+        /*
+         * Invert pnbeta(.) : 1. finding an upper and lower bound
+         */
+        if (p > 1 - DBL_EPSILON) {
+            return 1.0;
+        }
+        double pp = RMath.fmin2(1 - DBL_EPSILON, p * (1 + Eps));
+        double ux = 0.5;
+        while (ux < 1 - DBL_EPSILON && pnbeta.evaluate(ux, a, b, ncp, true, false) < pp) {
+            ux = 0.5 * (1 + ux);
+        }
+        pp = p * (1 - Eps);
+        double lx = 0.5;
+        while (lx > DBL_MIN && pnbeta.evaluate(lx, a, b, ncp, true, false) > pp) {
+            lx *= 0.5;
+        }
+
+        /* 2. interval (lx,ux) halving : */
+        double nx;
+        do {
+            nx = 0.5 * (lx + ux);
+            if (pnbeta.evaluate(nx, a, b, ncp, true, false) > p) {
+                ux = nx;
+            } else {
+                lx = nx;
+            }
+        } while ((ux - lx) / nx > accu);
+
+        return 0.5 * (ux + lx);
+    }
+}
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QNChisq.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QNChisq.java
new file mode 100644
index 0000000000000000000000000000000000000000..897f0875c98f71d88f6393779ab981589b33aa01
--- /dev/null
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QNChisq.java
@@ -0,0 +1,116 @@
+/*
+ * This material is distributed under the GNU General Public License
+ * Version 2. You may review the terms of this license at
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * Copyright (c) 1995, 1996  Robert Gentleman and Ross Ihaka
+ * Copyright (c) 2000-2008, The R Core Team
+ * Copyright (c) 2004, The R Foundation
+ * Copyright (c) 2016, Oracle and/or its affiliates
+ *
+ * All rights reserved.
+ */
+package com.oracle.truffle.r.library.stats;
+
+import static com.oracle.truffle.r.library.stats.MathConstants.DBL_EPSILON;
+import static com.oracle.truffle.r.library.stats.MathConstants.DBL_MAX;
+import static com.oracle.truffle.r.library.stats.MathConstants.DBL_MIN;
+
+import com.oracle.truffle.r.library.stats.Chisq.QChisq;
+import com.oracle.truffle.r.library.stats.DPQ.EarlyReturn;
+import com.oracle.truffle.r.library.stats.RMathError.MLError;
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function3_2;
+
+public class QNChisq implements Function3_2 {
+    private static final double accu = 1e-13;
+    private static final double racc = 4 * DBL_EPSILON;
+    /* these two are for the "search" loops, can have less accuracy: */
+    private static final double Eps = 1e-11; /* must be > accu */
+    private static final double rEps = 1e-10; /* relative tolerance ... */
+
+    private final QChisq qchisq = new QChisq();
+    private final PNChisq pnchisq = new PNChisq();
+
+    @Override
+    public double evaluate(double p, double df, double ncp, boolean lowerTail, boolean logP) {
+        if (Double.isNaN(p) || Double.isNaN(df) || Double.isNaN(ncp)) {
+            return p + df + ncp;
+        }
+        if (!Double.isFinite(df) || df < 0 || ncp < 0) {
+            return RMathError.defaultError();
+        }
+
+        try {
+            DPQ.rqp01boundaries(p, 0, Double.POSITIVE_INFINITY, lowerTail, logP);
+        } catch (EarlyReturn e) {
+            return e.result;
+        }
+
+        double pp = DPQ.rdqiv(p, logP);
+        if (pp > 1 - DBL_EPSILON) {
+            return lowerTail ? Double.POSITIVE_INFINITY : 0.0;
+        }
+
+        /*
+         * Invert pnchisq(.) : 1. finding an upper and lower bound
+         */
+
+        /*
+         * This is Pearson's (1959) approximation, which is usually good to 4 figs or so.
+         */
+        double b = (ncp * ncp) / (df + 3 * ncp);
+        double c = (df + 3 * ncp) / (df + 2 * ncp);
+        double ff = (df + 2 * ncp) / (c * c);
+        double ux = b + c * qchisq.evaluate(p, ff, lowerTail, logP);
+        if (ux < 0) {
+            ux = 1;
+        }
+        double ux0 = ux;
+
+        if (!lowerTail && ncp >= 80) {
+            /* in this case, pnchisq() works via lower_tail = true */
+            if (pp < 1e-10) {
+                RMathError.error(MLError.PRECISION, "qnchisq");
+            }
+            p = DPQ.rdtqiv(p, lowerTail, logP);
+            lowerTail = true;
+        } else {
+            p = pp;
+        }
+
+        pp = RMath.fmin2(1 - DBL_EPSILON, p * (1 + Eps));
+        while (ux < DBL_MAX && isLower(lowerTail, pnchisq.pnchisqRaw(ux, df, ncp, Eps, rEps, 10000, lowerTail, false), pp)) {
+            ux *= 2;
+        }
+        pp = p * (1 - Eps);
+        double lx = RMath.fmin2(ux0, DBL_MAX);
+        while (lx > DBL_MIN && isGreater(lowerTail, pnchisq.pnchisqRaw(lx, df, ncp, Eps, rEps, 10000, lowerTail, false), pp)) {
+            lx *= 0.5;
+        }
+
+        /* 2. interval (lx,ux) halving : */
+        double nx;
+        do {
+            nx = 0.5 * (lx + ux);
+            double raw = pnchisq.pnchisqRaw(nx, df, ncp, accu, racc, 100000, lowerTail, false);
+            if (isGreater(lowerTail, raw, p)) {
+                ux = nx;
+            } else {
+                lx = nx;
+            }
+        } while ((ux - lx) / nx > accu);
+
+        return 0.5 * (ux + lx);
+    }
+
+    /**
+     * Is greater that changes to is lower if {@code lowerTail} is {@code false}.
+     */
+    private boolean isGreater(boolean lowerTail, double raw, double p) {
+        return (lowerTail && raw > p) || (!lowerTail && raw < p);
+    }
+
+    private boolean isLower(boolean lowerTail, double raw, double p) {
+        return (lowerTail && raw < p) || (!lowerTail && raw > p);
+    }
+}
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Qnf.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Qnf.java
new file mode 100644
index 0000000000000000000000000000000000000000..7f06ef8e578ab80d6f28e4a67ba58ba53a8b45ae
--- /dev/null
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Qnf.java
@@ -0,0 +1,43 @@
+/*
+ * This material is distributed under the GNU General Public License
+ * Version 2. You may review the terms of this license at
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * Copyright (c) 2006-8, The R Core Team
+ * Copyright (c) 2016, Oracle and/or its affiliates
+ *
+ * All rights reserved.
+ */
+package com.oracle.truffle.r.library.stats;
+
+import com.oracle.truffle.r.library.stats.DPQ.EarlyReturn;
+import com.oracle.truffle.r.library.stats.StatsFunctions.Function4_2;
+
+public class Qnf implements Function4_2 {
+    private final QNChisq qnchisq = new QNChisq();
+    private final QNBeta qnbeta = new QNBeta();
+
+    @Override
+    public double evaluate(double p, double df1, double df2, double ncp, boolean lowerTail, boolean logP) {
+        if (Double.isNaN(p) || Double.isNaN(df1) || Double.isNaN(df2) || Double.isNaN(ncp)) {
+            return p + df1 + df2 + ncp;
+        }
+        if (df1 <= 0. || df2 <= 0. || ncp < 0 || !Double.isFinite(ncp) || !Double.isFinite(df1) && !Double.isFinite(df2)) {
+            return RMathError.defaultError();
+        }
+
+        try {
+            DPQ.rqp01boundaries(p, 0, Double.POSITIVE_INFINITY, lowerTail, logP);
+        } catch (EarlyReturn e) {
+            return e.result;
+        }
+
+        if (df2 > 1e8) {
+            /* avoid problems with +Inf and loss of accuracy */
+            return qnchisq.evaluate(p, df1, ncp, lowerTail, logP) / df1;
+        }
+
+        double y = qnbeta.evaluate(p, df1 / 2., df2 / 2., ncp, lowerTail, logP);
+        return y / (1 - y) * (df2 / df1);
+    }
+}
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/StatsFunctions.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/StatsFunctions.java
index 48c80044ba8a6b2d181a9f1e1b15564d5e66b66b..9d5484b7634f081ae94fb25cfd6e6d03b15decfd 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/StatsFunctions.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/StatsFunctions.java
@@ -21,6 +21,8 @@ import com.oracle.truffle.api.nodes.Node;
 import com.oracle.truffle.api.profiles.BranchProfile;
 import com.oracle.truffle.api.profiles.ConditionProfile;
 import com.oracle.truffle.api.profiles.LoopConditionProfile;
+import com.oracle.truffle.r.library.stats.StatsFunctionsFactory.Function4_1NodeGen;
+import com.oracle.truffle.r.library.stats.StatsFunctionsFactory.Function4_2NodeGen;
 import com.oracle.truffle.r.nodes.attributes.UnaryCopyAttributesNode;
 import com.oracle.truffle.r.nodes.builtin.CastBuilder;
 import com.oracle.truffle.r.nodes.builtin.RExternalBuiltinNode;
@@ -44,7 +46,25 @@ public final class StatsFunctions {
         // private
     }
 
-    public interface Function3_2 {
+    public interface Function4_2 {
+        double evaluate(double a, double b, double c, double d, boolean x, boolean y);
+    }
+
+    public interface Function4_1 extends Function4_2 {
+        @Override
+        default double evaluate(double a, double b, double c, double d, boolean x, boolean y) {
+            return evaluate(a, b, c, d, x);
+        }
+
+        double evaluate(double a, double b, double c, double d, boolean x);
+    }
+
+    public interface Function3_2 extends Function4_2 {
+        @Override
+        default double evaluate(double a, double b, double c, double d, boolean x, boolean y) {
+            return evaluate(a, b, c, x, y);
+        }
+
         double evaluate(double a, double b, double c, boolean x, boolean y);
     }
 
@@ -80,9 +100,11 @@ public final class StatsFunctions {
         final NACheck aCheck = NACheck.create();
         final NACheck bCheck = NACheck.create();
         final NACheck cCheck = NACheck.create();
+        final NACheck dCheck = NACheck.create();
         final ConditionProfile copyAttrsFromA = ConditionProfile.createBinaryProfile();
         final ConditionProfile copyAttrsFromB = ConditionProfile.createBinaryProfile();
         final ConditionProfile copyAttrsFromC = ConditionProfile.createBinaryProfile();
+        final ConditionProfile copyAttrsFromD = ConditionProfile.createBinaryProfile();
         final VectorLengthProfile resultVectorLengthProfile = VectorLengthProfile.create();
         final LoopConditionProfile loopConditionProfile = LoopConditionProfile.createCountingProfile();
 
@@ -91,15 +113,16 @@ public final class StatsFunctions {
         }
     }
 
-    private static RAbstractDoubleVector evaluate3(Node node, Function3_2 function, RAbstractDoubleVector a, RAbstractDoubleVector b, RAbstractDoubleVector c, boolean x, boolean y,
-                    StatFunctionProfiles profiles, UnaryCopyAttributesNode copyAttributesNode) {
+    private static RAbstractDoubleVector evaluate4(Node node, Function4_2 function, RAbstractDoubleVector a, RAbstractDoubleVector b, RAbstractDoubleVector c, RAbstractDoubleVector d, boolean x,
+                    boolean y, StatFunctionProfiles profiles, UnaryCopyAttributesNode copyAttributesNode) {
         int aLength = a.getLength();
         int bLength = b.getLength();
         int cLength = c.getLength();
-        if (aLength == 0 || bLength == 0 || cLength == 0) {
+        int dLength = d.getLength();
+        if (aLength == 0 || bLength == 0 || cLength == 0 || dLength == 0) {
             return RDataFactory.createEmptyDoubleVector();
         }
-        int length = profiles.resultVectorLengthProfile.profile(Math.max(aLength, Math.max(bLength, cLength)));
+        int length = profiles.resultVectorLengthProfile.profile(Math.max(aLength, Math.max(bLength, Math.max(cLength, dLength))));
         RNode.reportWork(node, length);
         double[] result = new double[length];
 
@@ -108,22 +131,24 @@ public final class StatsFunctions {
         profiles.aCheck.enable(a);
         profiles.bCheck.enable(b);
         profiles.cCheck.enable(c);
+        profiles.dCheck.enable(d);
         profiles.loopConditionProfile.profileCounted(length);
         for (int i = 0; profiles.loopConditionProfile.inject(i < length); i++) {
             double aValue = a.getDataAt(i % aLength);
             double bValue = b.getDataAt(i % bLength);
             double cValue = c.getDataAt(i % cLength);
+            double dValue = d.getDataAt(i % dLength);
             double value;
-            if (Double.isNaN(aValue) || Double.isNaN(bValue) || Double.isNaN(cValue)) {
+            if (Double.isNaN(aValue) || Double.isNaN(bValue) || Double.isNaN(cValue) || Double.isNaN(dValue)) {
                 profiles.nan.enter();
-                if (profiles.aCheck.check(aValue) || profiles.bCheck.check(bValue) || profiles.cCheck.check(cValue)) {
+                if (profiles.aCheck.check(aValue) || profiles.bCheck.check(bValue) || profiles.cCheck.check(cValue) || profiles.cCheck.check(dValue)) {
                     value = RRuntime.DOUBLE_NA;
                     complete = false;
                 } else {
                     value = Double.NaN;
                 }
             } else {
-                value = function.evaluate(aValue, bValue, cValue, x, y);
+                value = function.evaluate(aValue, bValue, cValue, dValue, x, y);
                 if (Double.isNaN(value)) {
                     profiles.nan.enter();
                     nans = true;
@@ -143,6 +168,8 @@ public final class StatsFunctions {
             copyAttributesNode.execute(resultVec, b);
         } else if (profiles.copyAttrsFromC.profile(cLength == length)) {
             copyAttributesNode.execute(resultVec, c);
+        } else if (profiles.copyAttrsFromD.profile((dLength == length))) {
+            copyAttributesNode.execute(resultVec, d);
         }
 
         return resultVec;
@@ -168,7 +195,64 @@ public final class StatsFunctions {
         protected RAbstractDoubleVector evaluate(RAbstractDoubleVector a, RAbstractDoubleVector b, RAbstractDoubleVector c, boolean x, boolean y,
                         @Cached("create()") StatFunctionProfiles profiles,
                         @Cached("create()") UnaryCopyAttributesNode copyAttributesNode) {
-            return evaluate3(this, function, a, b, c, x, y, profiles, copyAttributesNode);
+            return evaluate4(this, function, a, b, c, DUMMY_VECTOR, x, y, profiles, copyAttributesNode);
+        }
+    }
+
+    public abstract static class Function4_1Node extends RExternalBuiltinNode.Arg5 {
+        private final Function4_1 function;
+
+        public Function4_1Node(Function4_1 function) {
+            this.function = function;
+        }
+
+        public static Function4_1Node create(Function4_1 function) {
+            return Function4_1NodeGen.create(function);
+        }
+
+        @Override
+        protected void createCasts(CastBuilder casts) {
+            casts.arg(0).asDoubleVector();
+            casts.arg(1).asDoubleVector();
+            casts.arg(2).asDoubleVector();
+            casts.arg(3).asDoubleVector();
+            casts.arg(4).asLogicalVector().findFirst().map(toBoolean());
+        }
+
+        @Specialization
+        protected RAbstractDoubleVector evaluate(RAbstractDoubleVector a, RAbstractDoubleVector b, RAbstractDoubleVector c, RAbstractDoubleVector d, boolean x,
+                        @Cached("create()") StatFunctionProfiles profiles,
+                        @Cached("create()") UnaryCopyAttributesNode copyAttributesNode) {
+            return evaluate4(this, function, a, b, c, d, x, false /* dummy */, profiles, copyAttributesNode);
+        }
+    }
+
+    public abstract static class Function4_2Node extends RExternalBuiltinNode.Arg6 {
+        private final Function4_2 function;
+
+        public Function4_2Node(Function4_2 function) {
+            this.function = function;
+        }
+
+        public static Function4_2Node create(Function4_2 function) {
+            return Function4_2NodeGen.create(function);
+        }
+
+        @Override
+        protected void createCasts(CastBuilder casts) {
+            casts.arg(0).asDoubleVector();
+            casts.arg(1).asDoubleVector();
+            casts.arg(2).asDoubleVector();
+            casts.arg(3).asDoubleVector();
+            casts.arg(4).asLogicalVector().findFirst().map(toBoolean());
+            casts.arg(5).asLogicalVector().findFirst().map(toBoolean());
+        }
+
+        @Specialization
+        protected RAbstractDoubleVector evaluate(RAbstractDoubleVector a, RAbstractDoubleVector b, RAbstractDoubleVector c, RAbstractDoubleVector d, boolean x, boolean y,
+                        @Cached("create()") StatFunctionProfiles profiles,
+                        @Cached("create()") UnaryCopyAttributesNode copyAttributesNode) {
+            return evaluate4(this, function, a, b, c, d, x, y, profiles, copyAttributesNode);
         }
     }
 
@@ -191,7 +275,7 @@ public final class StatsFunctions {
         protected RAbstractDoubleVector evaluate(RAbstractDoubleVector a, RAbstractDoubleVector b, RAbstractDoubleVector c, boolean x,
                         @Cached("create()") StatFunctionProfiles profiles,
                         @Cached("create()") UnaryCopyAttributesNode copyAttributesNode) {
-            return evaluate3(this, function, a, b, c, x, false /* dummy */, profiles, copyAttributesNode);
+            return evaluate4(this, function, a, b, c, DUMMY_VECTOR, x, false /* dummy */, profiles, copyAttributesNode);
         }
     }
 
@@ -213,7 +297,7 @@ public final class StatsFunctions {
         protected RAbstractDoubleVector evaluate(RAbstractDoubleVector a, RAbstractDoubleVector b, boolean x,
                         @Cached("create()") StatFunctionProfiles profiles,
                         @Cached("create()") UnaryCopyAttributesNode copyAttributesNode) {
-            return evaluate3(this, function, a, b, DUMMY_VECTOR, x, false /* dummy */, profiles, copyAttributesNode);
+            return evaluate4(this, function, a, b, DUMMY_VECTOR, DUMMY_VECTOR, x, false /* dummy */, profiles, copyAttributesNode);
         }
     }
 
@@ -236,7 +320,7 @@ public final class StatsFunctions {
         protected RAbstractDoubleVector evaluate(RAbstractDoubleVector a, RAbstractDoubleVector b, boolean x, boolean y,
                         @Cached("create()") StatFunctionProfiles profiles,
                         @Cached("create()") UnaryCopyAttributesNode copyAttributesNode) {
-            return evaluate3(this, function, a, b, DUMMY_VECTOR, x, y, profiles, copyAttributesNode);
+            return evaluate4(this, function, a, b, DUMMY_VECTOR, DUMMY_VECTOR, x, y, profiles, copyAttributesNode);
         }
     }
 
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/TOMS708.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/TOMS708.java
index b9f92d9cb1fc14b314a0f88d0a71f6468d94292b..f335b9f7b1c29ec9b320e822ce49d48e54e6c971 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/TOMS708.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/TOMS708.java
@@ -11,7 +11,6 @@
  */
 package com.oracle.truffle.r.library.stats;
 
-import static com.oracle.truffle.r.library.stats.MathConstants.M_LN2;
 import static com.oracle.truffle.r.library.stats.MathConstants.M_LN_SQRT_2PI;
 import static com.oracle.truffle.r.library.stats.MathConstants.M_SQRT_PI;
 import static com.oracle.truffle.r.library.stats.MathConstants.logspaceAdd;
@@ -38,11 +37,6 @@ public class TOMS708 {
         RError.warning(RError.SHOW_CALLER, Message.GENERIC, String.format(format, args));
     }
 
-    // R_Log1_Exp
-    public static double log1Exp(double x) {
-        return ((x) > -M_LN2 ? log(-rexpm1(x)) : RMath.log1p(-exp(x)));
-    }
-
     private static double sin(double v) {
         return Math.sin(v);
     }
@@ -81,22 +75,6 @@ public class TOMS708 {
 
     private static final double ML_NEGINF = Double.NEGATIVE_INFINITY;
     private static final int INT_MAX = Integer.MAX_VALUE;
-    private static final double DBL_MIN = Double.MIN_NORMAL;
-    private static final double INV_SQRT_2_PI = .398942280401433; /* == 1/sqrt(2*pi); */
-
-    public static final class MathException extends RuntimeException {
-        private static final long serialVersionUID = -4745984791703065276L;
-
-        private final int code;
-
-        public MathException(int code) {
-            this.code = code;
-        }
-
-        public int getCode() {
-            return code;
-        }
-    }
 
     public static final class Bratio {
         public double w;
@@ -276,7 +254,7 @@ public class TOMS708 {
 
                                 if (b0 < Math.min(eps, eps * a0)) { /* L80: */
                                     w = fpser(a0, b0, x0, eps, logP);
-                                    w1 = logP ? log1Exp(w) : 0.5 - w + 0.5;
+                                    w1 = logP ? DPQ.rlog1exp(w) : 0.5 - w + 0.5;
                                     debugPrintf("  b0 small -> w := fpser(*) = %.15f\n", w);
                                     break L_end;
                                 }
@@ -424,7 +402,7 @@ public class TOMS708 {
 
                                 /* else if none of the above L180: */
                                 w = basym(a0, b0, lambda, eps * 100.0, logP);
-                                w1 = logP ? log1Exp(w) : 0.5 - w + 0.5;
+                                w1 = logP ? DPQ.rlog1exp(w) : 0.5 - w + 0.5;
                                 debugPrintf("  b0 >= a0 > 100; lambda <= a0 * 0.03: *w:= basym(*) =%.15f\n", w);
                                 break L_end;
 
@@ -434,19 +412,19 @@ public class TOMS708 {
 
                         case L_w_bpser: // was L100
                             w = bpser(a0, b0, x0, eps, logP);
-                            w1 = logP ? log1Exp(w) : 0.5 - w + 0.5;
+                            w1 = logP ? DPQ.rlog1exp(w) : 0.5 - w + 0.5;
                             debugPrintf(" L_w_bpser: *w := bpser(*) = %.1fg\n", w);
                             break L_end;
 
                         case L_w1_bpser:  // was L110
                             w1 = bpser(b0, a0, y0, eps, logP);
-                            w = logP ? log1Exp(w1) : 0.5 - w1 + 0.5;
+                            w = logP ? DPQ.rlog1exp(w1) : 0.5 - w1 + 0.5;
                             debugPrintf(" L_w1_bpser: *w1 := bpser(*) = %.15f\n", w1);
                             break L_end;
 
                         case L_bfrac:
                             w = bfrac(a0, b0, x0, y0, lambda, eps * 15.0, logP);
-                            w1 = logP ? log1Exp(w) : 0.5 - w + 0.5;
+                            w1 = logP ? DPQ.rlog1exp(w) : 0.5 - w + 0.5;
                             debugPrintf(" L_bfrac: *w := bfrac(*) = %f\n", w);
                             break L_end;
 
@@ -462,7 +440,7 @@ public class TOMS708 {
                             w = bup(b0, a0, y0, x0, n, eps, false);
 
                             debugPrintf(" L140: *w := bup(b0=%g,..) = %.15f; ", b0, w);
-                            if (w < DBL_MIN && logP) {
+                            if (w < MathConstants.DBL_MIN && logP) {
                                 /* do not believe it; try bpser() : */
                                 /* revert: */b0 += n;
                                 /* which is only valid if b0 <= 1 || b0*x0 <= 0.7 */
@@ -520,7 +498,7 @@ public class TOMS708 {
                             // *w1 = log(w1) already; w = 1 - w1 ==> log(w) = log(1 - w1) = log(1 -
                             // exp(*w1))
                             if (logP) {
-                                w = log1Exp(w1);
+                                w = DPQ.rlog1exp(w1);
                             } else {
                                 w = /* 1 - exp(*w1) */-Math.expm1(w1);
                                 w1 = Math.exp(w1);
@@ -658,7 +636,6 @@ public class TOMS708 {
             } else {
                 w += (u0 ? Math.exp(logU + Math.log(sum)) : u * sum);
             }
-            return;
         } /* bgrat */
     }
 
@@ -1177,7 +1154,7 @@ public class TOMS708 {
 
             double z = logP ? -(a * u + b * v) : exp(-(a * u + b * v));
 
-            return (logP ? -M_LN_SQRT_2PI + .5 * log(b * x0) + z - bcorr(a, b) : INV_SQRT_2_PI * sqrt(b * x0) * z * exp(-bcorr(a, b)));
+            return (logP ? -M_LN_SQRT_2PI + .5 * log(b * x0) + z - bcorr(a, b) : MathConstants.INV_SQRT_2_PI * sqrt(b * x0) * z * exp(-bcorr(a, b)));
         }
     } /* brcomp */
 
@@ -1323,7 +1300,7 @@ public class TOMS708 {
 
             // L130:
             double z = esum(mu, -(a * u + b * v), giveLog);
-            return giveLog ? log(INV_SQRT_2_PI) + (log(b) + lx0) / 2. + z - bcorr(a, b) : INV_SQRT_2_PI * sqrt(b * x0) * z * exp(-bcorr(a, b));
+            return giveLog ? log(MathConstants.INV_SQRT_2_PI) + (log(b) + lx0) / 2. + z - bcorr(a, b) : MathConstants.INV_SQRT_2_PI * sqrt(b * x0) * z * exp(-bcorr(a, b));
         }
     } /* brcmp1 */
 
diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/CallAndExternalFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/CallAndExternalFunctions.java
index 6a242920859717a42891dd06f8bdcf71df35e88c..41d336596c73db6503e0e88aef10138663730192 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/CallAndExternalFunctions.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/foreign/CallAndExternalFunctions.java
@@ -51,10 +51,14 @@ import com.oracle.truffle.r.library.stats.CompleteCases;
 import com.oracle.truffle.r.library.stats.CovcorNodeGen;
 import com.oracle.truffle.r.library.stats.CutreeNodeGen;
 import com.oracle.truffle.r.library.stats.DBeta;
+import com.oracle.truffle.r.library.stats.DHyper;
+import com.oracle.truffle.r.library.stats.DNBeta;
+import com.oracle.truffle.r.library.stats.DNChisq;
 import com.oracle.truffle.r.library.stats.DNorm;
 import com.oracle.truffle.r.library.stats.DPois;
 import com.oracle.truffle.r.library.stats.Dbinom;
 import com.oracle.truffle.r.library.stats.Df;
+import com.oracle.truffle.r.library.stats.Dnf;
 import com.oracle.truffle.r.library.stats.DoubleCentreNodeGen;
 import com.oracle.truffle.r.library.stats.Dt;
 import com.oracle.truffle.r.library.stats.Exp.DExp;
@@ -74,16 +78,24 @@ import com.oracle.truffle.r.library.stats.Logis;
 import com.oracle.truffle.r.library.stats.Logis.DLogis;
 import com.oracle.truffle.r.library.stats.Logis.RLogis;
 import com.oracle.truffle.r.library.stats.PGamma;
+import com.oracle.truffle.r.library.stats.PHyper;
+import com.oracle.truffle.r.library.stats.PNBeta;
+import com.oracle.truffle.r.library.stats.PNChisq;
 import com.oracle.truffle.r.library.stats.PPois;
 import com.oracle.truffle.r.library.stats.Pbeta;
 import com.oracle.truffle.r.library.stats.Pbinom;
 import com.oracle.truffle.r.library.stats.Pf;
+import com.oracle.truffle.r.library.stats.Pnf;
 import com.oracle.truffle.r.library.stats.Pnorm;
 import com.oracle.truffle.r.library.stats.Pt;
 import com.oracle.truffle.r.library.stats.QBeta;
+import com.oracle.truffle.r.library.stats.QHyper;
+import com.oracle.truffle.r.library.stats.QNBeta;
+import com.oracle.truffle.r.library.stats.QNChisq;
 import com.oracle.truffle.r.library.stats.QPois;
 import com.oracle.truffle.r.library.stats.Qbinom;
 import com.oracle.truffle.r.library.stats.Qf;
+import com.oracle.truffle.r.library.stats.Qnf;
 import com.oracle.truffle.r.library.stats.Qnorm;
 import com.oracle.truffle.r.library.stats.Qt;
 import com.oracle.truffle.r.library.stats.RBeta;
@@ -105,6 +117,7 @@ import com.oracle.truffle.r.library.stats.Rt;
 import com.oracle.truffle.r.library.stats.Signrank.RSignrank;
 import com.oracle.truffle.r.library.stats.SplineFunctionsFactory.SplineCoefNodeGen;
 import com.oracle.truffle.r.library.stats.SplineFunctionsFactory.SplineEvalNodeGen;
+import com.oracle.truffle.r.library.stats.StatsFunctions;
 import com.oracle.truffle.r.library.stats.StatsFunctionsFactory;
 import com.oracle.truffle.r.library.stats.Unif.DUnif;
 import com.oracle.truffle.r.library.stats.Unif.PUnif;
@@ -299,6 +312,18 @@ public class CallAndExternalFunctions {
                     return RandFunction1Node.createInt(new RSignrank());
                 case "rhyper":
                     return RandFunction3Node.createInt(new RHyper());
+                case "phyper":
+                    return StatsFunctions.Function4_2Node.create(new PHyper());
+                case "dhyper":
+                    return StatsFunctions.Function4_1Node.create(new DHyper());
+                case "qhyper":
+                    return StatsFunctions.Function4_2Node.create(new QHyper());
+                case "pnchisq":
+                    return StatsFunctionsFactory.Function3_2NodeGen.create(new PNChisq());
+                case "qnchisq":
+                    return StatsFunctionsFactory.Function3_2NodeGen.create(new QNChisq());
+                case "dnchisq":
+                    return StatsFunctionsFactory.Function3_1NodeGen.create(new DNChisq());
                 case "qt":
                     return StatsFunctionsFactory.Function2_2NodeGen.create(new Qt());
                 case "pt":
@@ -363,6 +388,18 @@ public class CallAndExternalFunctions {
                     return StatsFunctionsFactory.Function2_1NodeGen.create(new DPois());
                 case "dbeta":
                     return StatsFunctionsFactory.Function3_1NodeGen.create(new DBeta());
+                case "dnbeta":
+                    return StatsFunctions.Function4_1Node.create(new DNBeta());
+                case "qnbeta":
+                    return StatsFunctions.Function4_2Node.create(new QNBeta());
+                case "dnf":
+                    return StatsFunctions.Function4_1Node.create(new Dnf());
+                case "qnf":
+                    return StatsFunctions.Function4_2Node.create(new Qnf());
+                case "pnf":
+                    return StatsFunctions.Function4_2Node.create(new Pnf());
+                case "pnbeta":
+                    return StatsFunctions.Function4_2Node.create(new PNBeta());
                 case "dt":
                     return StatsFunctionsFactory.Function2_1NodeGen.create(new Dt());
                 case "rlnorm":
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java
index 71a773f40370e557819700005a3f0f87291abb6f..1524ea35092e4342ddb353de67224bf76cc223cb 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java
@@ -533,6 +533,7 @@ public final class RError extends RuntimeException {
         NEGATIVE_PROBABILITY("negative probability"),
         NO_POSITIVE_PROBABILITIES("no positive probabilities"),
         QBETA_ACURACY_WARNING("qbeta(a, *) =: x0 with |pbeta(x0,*%s) - alpha| = %.5g is not accurate"),
+        PCHISQ_NOT_CONVERGED_WARNING("pnchisq(x=%g, ..): not converged in %d iter."),
         NON_POSITIVE_FILL("non-positive 'fill' argument will be ignored"),
         MUST_BE_ONE_BYTE("invalid %s: must be one byte"),
         INVALID_DECIMAL_SEP("invalid decimal separator"),
diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test
index 6ed10247f02af0042cba428563448e5dd1bd96fb..dc3c97220c2c5ee01180d4c307d570c1f7fae073 100644
--- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test
+++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test
@@ -111561,16 +111561,34 @@ attr(,"is.truffle.object")
 Warning message:
 In dbeta(0, -1, 0.5) : NaNs produced
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, -4,  15,  0)
+[1] NaN
+Warning message:
+In dbeta(0, -4, 15, 0) : NaNs produced
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
 #dbeta(0, -Inf,  0.5)
 [1] NaN
 Warning message:
 In dbeta(0, -Inf, 0.5) : NaNs produced
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, -Inf,  15,  0)
+[1] NaN
+Warning message:
+In dbeta(0, -Inf, 15, 0) : NaNs produced
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
 #dbeta(0, 0,  0.5)
 [1] Inf
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, 0,  15,  0)
+[1] NaN
+Warning message:
+In dbeta(0, 0, 15, 0) : NaNs produced
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
 #dbeta(0, 0.5, -1)
 [1] NaN
@@ -111595,14 +111613,78 @@ In dbeta(0, 0.5, -Inf) : NaNs produced
 #dbeta(0, 0.5, NaN)
 [1] NaN
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, 10,  15, -4)
+[1] NaN
+Warning message:
+In dbeta(0, 10, 15, -4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, 10,  15, -Inf)
+[1] NaN
+Warning message:
+In dbeta(0, 10, 15, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, 10,  15, 0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, 10,  15, Inf)
+[1] NaN
+Warning message:
+In dbeta(0, 10, 15, Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, 10,  15, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, 10, -4,  0)
+[1] NaN
+Warning message:
+In dbeta(0, 10, -4, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, 10, -Inf,  0)
+[1] NaN
+Warning message:
+In dbeta(0, 10, -Inf, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, 10, 0,  0)
+[1] NaN
+Warning message:
+In dbeta(0, 10, 0, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, 10, Inf,  0)
+[1] NaN
+Warning message:
+In dbeta(0, 10, Inf, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, 10, NaN,  0)
+[1] NaN
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
 #dbeta(0, Inf,  0.5)
 [1] 0
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, Inf,  15,  0)
+[1] NaN
+Warning message:
+In dbeta(0, Inf, 15, 0) : NaNs produced
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
 #dbeta(0, NaN,  0.5)
 [1] NaN
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(0, NaN,  15,  0)
+[1] NaN
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
 #dbeta(c(-Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0.5, 0.5, log=F)
 [1] 0.000000e+00 0.000000e+00          Inf 4.911628e+14 0.000000e+00
@@ -111662,6 +111744,42 @@ In dbeta(0, 0.5, -Inf) : NaNs produced
 #dbeta(c(0.6, 0.1, 42e-33), 6, 3, log=T)
 [1]    0.7372544   -6.5996825 -356.1142283
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(c(10, 15, 100), 7, 11, 0.37e-10, log=F)
+[1] 0 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(c(10, 15, 100), 7, 11, 0.37e-10, log=T)
+[1] -Inf -Inf -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(c(10, 15, 100), 7, 113e11, 1, log=F)
+[1] 0 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(c(10, 15, 100), 7, 113e11, 1, log=T)
+[1] -Inf -Inf -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 10, 15, 0, log=F)
+[1]  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
+[6]  0.000000e+00 7.975867e-267  0.000000e+00           NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 10, 15, 0, log=T)
+[1]      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf -612.7138
+[8]      -Inf       NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 7, 13, 3, log=F)
+[1]  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
+[6]  0.000000e+00 4.319955e-178  0.000000e+00           NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 7, 13, 3, log=T)
+[1]      -Inf      -Inf      -Inf      -Inf      -Inf      -Inf -408.3969
+[8]      -Inf       NaN
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
 #dcauchy(0, -Inf,  -1)
 [1] NaN
@@ -111722,6 +111840,92 @@ In dcauchy(c(0, -1, 42), 0, -1, log = F) : NaNs produced
 Warning message:
 In dcauchy(c(0, -1, 42), 0, -1, log = T) : NaNs produced
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(0, -3,  1)
+[1] NaN
+Warning message:
+In dchisq(0, -3, 1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(0, -Inf,  1)
+[1] NaN
+Warning message:
+In dchisq(0, -Inf, 1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(0, 0,  1)
+[1] Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(0, 1, -3)
+[1] NaN
+Warning message:
+In dchisq(0, 1, -3) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(0, 1, -Inf)
+[1] NaN
+Warning message:
+In dchisq(0, 1, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(0, 1, 0)
+[1] Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(0, 1, Inf)
+[1] NaN
+Warning message:
+In dchisq(0, 1, Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(0, 1, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(0, Inf,  1)
+[1] NaN
+Warning message:
+In dchisq(0, Inf, 1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(0, NaN,  1)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(c(0.42e-10, 100, 13e10, 11e111), 0.13e-8, 1, log=F)
+[1] 9.538417e+00 1.370516e-20 0.000000e+00 0.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(c(0.42e-10, 100, 13e10, 11e111), 0.13e-8, 1, log=T)
+[1]   2.255327e+00  -4.573651e+01  -3.250000e+10 -2.750000e+111
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(c(0.42e-10, 100, 13e10, 11e111), 1, 0.13e-8, log=F)
+[1] 6.155813e+04 7.694599e-24 0.000000e+00 0.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(c(0.42e-10, 100, 13e10, 11e111), 1, 0.13e-8, log=T)
+[1]   1.102774e+01  -5.322152e+01  -6.500000e+10 -5.500000e+111
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(c(0.42e-10, 100, 13e10, 11e111), 420, 4, log=F)
+[1] 0.000000e+00 5.065225e-64 0.000000e+00 0.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(c(0.42e-10, 100, 13e10, 11e111), 420, 4, log=T)
+[1]  -6.052932e+03  -1.457430e+02  -6.439252e+10 -5.448598e+111
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(c(0.5, 2, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 1, 1, log=F)
+[1] 3.359531e-01 1.371033e-01 0.000000e+00 0.000000e+00          Inf
+[6] 3.733689e+14 0.000000e+00          NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dchisq(c(0.5, 2, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 1, 1, log=T)
+[1] -1.090784 -1.987021      -Inf      -Inf       Inf 33.553588      -Inf
+[8]       NaN
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
 #dexp(0, -1)
 [1] NaN
@@ -111775,6 +111979,149 @@ In dexp(0, Inf) : NaNs produced
 [1] -1760.26233        -Inf        -Inf     3.73767     3.73767        -Inf
 [7]         NaN
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, -1,  5,  5)
+[1] NaN
+Warning message:
+In df(0, -1, 5, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, -Inf,  5,  5)
+[1] NaN
+Warning message:
+In df(0, -Inf, 5, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, 0,  5,  5)
+[1] NaN
+Warning message:
+In df(0, 0, 5, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, 5,  5, -1)
+[1] NaN
+Warning message:
+In df(0, 5, 5, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, 5,  5, -Inf)
+[1] NaN
+Warning message:
+In df(0, 5, 5, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, 5,  5, 0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, 5,  5, Inf)
+[1] NaN
+Warning message:
+In df(0, 5, 5, Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, 5,  5, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, 5, -1,  5)
+[1] NaN
+Warning message:
+In df(0, 5, -1, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, 5, -Inf,  5)
+[1] NaN
+Warning message:
+In df(0, 5, -Inf, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, 5, 0,  5)
+[1] NaN
+Warning message:
+In df(0, 5, 0, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, 5, Inf,  5)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, 5, NaN,  5)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, Inf,  5,  5)
+[1] NaN
+Warning message:
+In df(0, Inf, 5, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(0, NaN,  5,  5)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0.12e-10, 6, 31e10, log=F)
+ [1]   0   0   0   0   0   0 Inf   0 NaN NaN
+Warning message:
+In df(c(1, 10, 44, 123, -Inf, -4.2e-31, 0, 4.2e-31, Inf, NaN), 1.2e-11,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0.12e-10, 6, 31e10, log=T)
+ [1] -1.55e+11 -1.55e+11 -1.55e+11 -1.55e+11      -Inf      -Inf       Inf
+ [8] -1.55e+11       NaN       NaN
+Warning message:
+In df(c(1, 10, 44, 123, -Inf, -4.2e-31, 0, 4.2e-31, Inf, NaN), 1.2e-11,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 0.12e-10, 5, log=F)
+ [1] 6.000077e-12 5.999245e-13 1.364474e-13 4.871126e-14 0.000000e+00
+ [6] 0.000000e+00 0.000000e+00 1.502315e-29          NaN          NaN
+Warning message:
+In df(c(1, 10, 44, 123, -Inf, -4.2e-31, 0, 4.2e-31, Inf, NaN), 5,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 0.12e-10, 5, log=T)
+ [1] -25.83925 -28.14197 -29.62284 -30.65287      -Inf      -Inf      -Inf
+ [8] -66.36796       NaN       NaN
+Warning message:
+In df(c(1, 10, 44, 123, -Inf, -4.2e-31, 0, 4.2e-31, Inf, NaN), 5,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 5, 5, log=F)
+ [1] 3.161392e-01 9.493410e-03 9.824795e-05 3.042534e-06 0.000000e+00
+ [6] 0.000000e+00 0.000000e+00 3.034426e-46          NaN          NaN
+Warning message:
+In df(c(1, 10, 44, 123, -Inf, -4.2e-31, 0, 4.2e-31, Inf, NaN), 5,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 5, 5, log=T)
+ [1]   -1.151573   -4.657157   -9.228016  -12.702820        -Inf        -Inf
+ [7]        -Inf -104.808892         NaN         NaN
+Warning message:
+In df(c(1, 10, 44, 123, -Inf, -4.2e-31, 0, 4.2e-31, Inf, NaN), 5,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 6, 0.12e-10, log=F)
+ [1] 4.450508e-01 1.824043e-03 7.828020e-06 1.409040e-07 0.000000e+00
+ [6] 0.000000e+00 0.000000e+00 3.397124e-45          NaN          NaN
+Warning message:
+In df(c(1, 10, 44, 123, -Inf, -4.2e-31, 0, 4.2e-31, Inf, NaN), 5,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#df(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 6, 0.12e-10, log=T)
+ [1]   -0.8095669   -6.3066996  -11.7578009  -15.7751873         -Inf
+ [6]         -Inf         -Inf -102.3934000          NaN          NaN
+Warning message:
+In df(c(1, 10, 44, 123, -Inf, -4.2e-31, 0, 4.2e-31, Inf, NaN), 5,  :
+  NaNs produced
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
 #dgamma(0, -1,  scale=2)
 [1] NaN
@@ -111842,70 +112189,218 @@ In dgamma(0, 1, Inf) : NaNs produced
 [1] -1.417138e+12 -1.735695e+13          -Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(0, -Inf,  -1)
+#dhyper(0, -10,  11,  4)
 [1] NaN
 Warning message:
-In dnorm(0, -Inf, -1) : NaNs produced
-
-##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(0, 0, -Inf)
-[1] 0
+In dhyper(0, -10, 11, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(0, 0, Inf)
-[1] 0
+#dhyper(0, -Inf,  11,  4)
+[1] NaN
+Warning message:
+In dhyper(0, -Inf, 11, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(0, 0, NaN)
+#dhyper(0, 0.3,  11,  4)
 [1] NaN
+Warning message:
+In dhyper(0, 0.3, 11, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(0, Inf,  -1)
+#dhyper(0, 7,  11, -10)
 [1] NaN
 Warning message:
-In dnorm(0, Inf, -1) : NaNs produced
+In dhyper(0, 7, 11, -10) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(0, NaN,  -1)
+#dhyper(0, 7,  11, -Inf)
 [1] NaN
+Warning message:
+In dhyper(0, 7, 11, -Inf) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(c(0), 0, -1, log=F)
+#dhyper(0, 7,  11, 0.3)
 [1] NaN
 Warning message:
-In dnorm(c(0), 0, -1, log = F) : NaNs produced
+In dhyper(0, 7, 11, 0.3) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(c(0), 0, -1, log=T)
+#dhyper(0, 7,  11, Inf)
 [1] NaN
 Warning message:
-In dnorm(c(0), 0, -1, log = T) : NaNs produced
+In dhyper(0, 7, 11, Inf) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, log=F)
-[1]   0   0   0 Inf   0   0 NaN
+#dhyper(0, 7,  11, NaN)
+[1] NaN
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, log=T)
-[1] -Inf -Inf -Inf  Inf -Inf -Inf  NaN
+#dhyper(0, 7, -10,  4)
+[1] NaN
+Warning message:
+In dhyper(0, 7, -10, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(c(4, -100, 0), 4, 4, log=F)
-[1]  9.973557e-02 1.611815e-148  6.049268e-02
+#dhyper(0, 7, -Inf,  4)
+[1] NaN
+Warning message:
+In dhyper(0, 7, -Inf, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dnorm(c(4, -100, 0), 4, 4, log=T)
-[1]   -2.305233 -340.305233   -2.805233
+#dhyper(0, 7, 0.3,  4)
+[1] NaN
+Warning message:
+In dhyper(0, 7, 0.3, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dunif(0, -3, -Inf)
+#dhyper(0, 7, Inf,  4)
 [1] NaN
 Warning message:
-In dunif(0, -3, -Inf) : NaNs produced
+In dhyper(0, 7, Inf, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
-#dunif(0, -3, Inf)
-[1] 0
+#dhyper(0, 7, NaN,  4)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(0, Inf,  11,  4)
+[1] NaN
+Warning message:
+In dhyper(0, Inf, 11, 4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(0, NaN,  11,  4)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(0.1, -Inf, Inf, 0.3e89), 5, 5, 5, log=F)
+[1] 0 0 0 0
+Warning message:
+In dhyper(c(0.1, -Inf, Inf, 3e+88), 5, 5, 5, log = F) :
+  non-integer x = 0.100000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(0.1, -Inf, Inf, 0.3e89), 5, 5, 5, log=T)
+[1] -Inf -Inf -Inf -Inf
+Warning message:
+In dhyper(c(0.1, -Inf, Inf, 3e+88), 5, 5, 5, log = T) :
+  non-integer x = 0.100000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(1, 2, 3, 4, 20, 12e12), 7, 11, 4, log=F)
+[1] 0.37745098 0.37745098 0.12581699 0.01143791 0.00000000 0.00000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(1, 2, 3, 4, 20, 12e12), 7, 11, 4, log=T)
+[1] -0.9743146 -0.9743146 -2.0729269 -4.4708221       -Inf       -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(1, 2, 3, 4, 20, 12e12), 7e12, 11, 4, log=F)
+[1] 1.154519e-35 1.346939e-23 6.285714e-12 1.000000e+00 0.000000e+00
+[6] 0.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(1, 2, 3, 4, 20, 12e12), 7e12, 11, 4, log=T)
+[1] -8.044679e+01 -5.266162e+01 -2.579274e+01 -6.285639e-12          -Inf
+[6]          -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(1, 2, 3, 4, 5, 6, 7, 8, 11, 20, 12e12), 7, 11, 12, log=F)
+ [1] 0.0003770739 0.0124434389 0.1036953243 0.3110859729 0.3733031674
+ [6] 0.1742081448 0.0248868778 0.0000000000 0.0000000000 0.0000000000
+[11] 0.0000000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(1, 2, 3, 4, 5, 6, 7, 8, 11, 20, 12e12), 7, 11, 12, log=T)
+ [1] -7.8830694 -4.3865618 -2.2662983 -1.1676860 -0.9853644 -1.7475045
+ [7] -3.6934146       -Inf       -Inf       -Inf       -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(1, 2, 3, 7, 20, 12e12), 11, 7e12, 7, log=F)
+[1] 1.100000e-11 4.714286e-23 1.010204e-34 2.019567e-84 0.000000e+00
+[6] 0.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(1, 2, 3, 7, 20, 12e12), 11, 7e12, 7, log=T)
+[1]  -25.23313  -51.40886  -78.27774 -192.71426       -Inf       -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(2), 3, 4, 10, log=F)
+[1] NaN
+Warning message:
+In dhyper(c(2), 3, 4, 10, log = F) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dhyper(c(2), 3, 4, 10, log=T)
+[1] NaN
+Warning message:
+In dhyper(c(2), 3, 4, 10, log = T) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(0, -Inf,  -1)
+[1] NaN
+Warning message:
+In dnorm(0, -Inf, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(0, 0, -Inf)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(0, 0, Inf)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(0, 0, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(0, Inf,  -1)
+[1] NaN
+Warning message:
+In dnorm(0, Inf, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(0, NaN,  -1)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(c(0), 0, -1, log=F)
+[1] NaN
+Warning message:
+In dnorm(c(0), 0, -1, log = F) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(c(0), 0, -1, log=T)
+[1] NaN
+Warning message:
+In dnorm(c(0), 0, -1, log = T) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, log=F)
+[1]   0   0   0 Inf   0   0 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, log=T)
+[1] -Inf -Inf -Inf  Inf -Inf -Inf  NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(c(4, -100, 0), 4, 4, log=F)
+[1]  9.973557e-02 1.611815e-148  6.049268e-02
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dnorm(c(4, -100, 0), 4, 4, log=T)
+[1]   -2.305233 -340.305233   -2.805233
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dunif(0, -3, -Inf)
+[1] NaN
+Warning message:
+In dunif(0, -3, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
+#dunif(0, -3, Inf)
+[1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDensityFunctions#Output.MayIgnoreWarningContext#
 #dunif(0, -3, NaN)
@@ -111941,16 +112436,28 @@ In dunif(0, Inf, 3.3) : NaNs produced
 Warning message:
 In pbeta(0, -1, 0.5) : NaNs produced
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, -4,  15,  0)
+[1] 0
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
 #pbeta(0, -Inf,  0.5)
 [1] NaN
 Warning message:
 In pbeta(0, -Inf, 0.5) : NaNs produced
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, -Inf,  15,  0)
+[1] 0
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
 #pbeta(0, 0,  0.5)
 [1] 0
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, 0,  15,  0)
+[1] 0
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
 #pbeta(0, 0.5, -1)
 [1] NaN
@@ -111975,14 +112482,62 @@ In pbeta(0, 0.5, -Inf) : NaNs produced
 #pbeta(0, 0.5, NaN)
 [1] NaN
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, 10,  15, -4)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, 10,  15, -Inf)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, 10,  15, 0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, 10,  15, Inf)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, 10,  15, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, 10, -4,  0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, 10, -Inf,  0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, 10, 0,  0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, 10, Inf,  0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, 10, NaN,  0)
+[1] NaN
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
 #pbeta(0, Inf,  0.5)
 [1] 0
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, Inf,  15,  0)
+[1] 0
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
 #pbeta(0, NaN,  0.5)
 [1] NaN
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(0, NaN,  15,  0)
+[1] NaN
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
 #pbeta(c(-Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0.5, 0.5, lower.tail=F, log.p=F)
 [1]   1   1   1   1   0 NaN
@@ -112103,6 +112658,76 @@ In pbeta(0, 0.5, -Inf) : NaNs produced
 #pbeta(c(0.6, 0.1, 42e-33), 6, 3, lower.tail=T, log.p=T)
 [1]   -1.153931  -10.662347 -430.153626
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100), 7, 11, 0.37e-10, lower.tail=F, log.p=F)
+[1] 0 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100), 7, 11, 0.37e-10, lower.tail=F, log.p=T)
+[1] -Inf -Inf -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100), 7, 11, 0.37e-10, lower.tail=T, log.p=F)
+[1] 1 1 1
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100), 7, 11, 0.37e-10, lower.tail=T, log.p=T)
+[1] 0 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100), 7, 113e11, 1, lower.tail=F, log.p=F)
+[1] 0 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100), 7, 113e11, 1, lower.tail=F, log.p=T)
+[1] -Inf -Inf -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100), 7, 113e11, 1, lower.tail=T, log.p=F)
+[1] 1 1 1
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100), 7, 113e11, 1, lower.tail=T, log.p=T)
+[1] 0 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 10, 15, 0, lower.tail=F, log.p=F)
+[1]   0   0   0   1   1   1   1   0 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 10, 15, 0, lower.tail=F, log.p=T)
+[1]           -Inf           -Inf           -Inf   0.000000e+00   0.000000e+00
+[6]   0.000000e+00 -3.349864e-298           -Inf            NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 10, 15, 0, lower.tail=T, log.p=F)
+[1]  1.000000e+00  1.000000e+00  1.000000e+00  0.000000e+00  0.000000e+00
+[6]  0.000000e+00 3.349864e-298  1.000000e+00           NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 10, 15, 0, lower.tail=T, log.p=T)
+[1]    0.0000    0.0000    0.0000      -Inf      -Inf      -Inf -684.9614
+[8]    0.0000       NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 7, 13, 3, lower.tail=F, log.p=F)
+[1]   0   0   0   1   1   1   1   0 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 7, 13, 3, lower.tail=F, log.p=T)
+[1]           -Inf           -Inf           -Inf   0.000000e+00   0.000000e+00
+[6]   0.000000e+00 -2.591973e-209           -Inf            NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 7, 13, 3, lower.tail=T, log.p=F)
+[1]  1.000000e+00  1.000000e+00  1.000000e+00  0.000000e+00  0.000000e+00
+[6]  0.000000e+00 2.591973e-209  1.000000e+00           NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pbeta(c(10, 15, 100, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 7, 13, 3, lower.tail=T, log.p=T)
+[1]    0.0000    0.0000    0.0000      -Inf      -Inf      -Inf -480.2879
+[8]    0.0000       NaN
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
 #pcauchy(0, -Inf,  -1)
 [1] NaN
@@ -112194,108 +112819,381 @@ Warning message:
 In pcauchy(c(0, -1, 42), 0, -1, lower.tail = T, log.p = T) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(0, -1)
+#pchisq(0, -3,  1)
 [1] NaN
 Warning message:
-In pexp(0, -1) : NaNs produced
+In pchisq(0, -3, 1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(0, -Inf)
-[1] 0
+#pchisq(0, -Inf,  1)
+[1] NaN
+Warning message:
+In pchisq(0, -Inf, 1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(0, 0)
-[1] 0
+#pchisq(0, 0,  1)
+[1] 0.6065307
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(0, Inf)
-[1] 0
+#pchisq(0, 1, -3)
+[1] NaN
+Warning message:
+In pchisq(0, 1, -3) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(0, NaN)
+#pchisq(0, 1, -Inf)
 [1] NaN
+Warning message:
+In pchisq(0, 1, -Inf) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(10, -10, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 13e-20, lower.tail=F, log.p=F)
-[1]   1   1   1   1   1   1   0 NaN
+#pchisq(0, 1, 0)
+[1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(10, -10, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 13e-20, lower.tail=F, log.p=T)
-[1] -1.30e-18  0.00e+00  0.00e+00  0.00e+00  0.00e+00 -5.46e-50      -Inf
-[8]       NaN
+#pchisq(0, 1, Inf)
+[1] NaN
+Warning message:
+In pchisq(0, 1, Inf) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(10, -10, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 13e-20, lower.tail=T, log.p=F)
-[1] 1.30e-18 0.00e+00 0.00e+00 0.00e+00 0.00e+00 5.46e-50 1.00e+00      NaN
+#pchisq(0, 1, NaN)
+[1] NaN
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(10, -10, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 13e-20, lower.tail=T, log.p=T)
-[1]  -41.18417       -Inf       -Inf       -Inf       -Inf -113.43181    0.00000
-[8]        NaN
+#pchisq(0, Inf,  1)
+[1] NaN
+Warning message:
+In pchisq(0, Inf, 1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(33e123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42e123, lower.tail=F, log.p=F)
-[1]   0   1   1   1   0   0 NaN
+#pchisq(0, NaN,  1)
+[1] NaN
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(33e123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42e123, lower.tail=F, log.p=T)
-[1] -1.386e+249   0.000e+00   0.000e+00   0.000e+00  -1.764e+94        -Inf
-[7]         NaN
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 0.13e-8, 1, lower.tail=F, log.p=F)
+[1] 3.934693e-01 3.413625e-20 0.000000e+00 0.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(33e123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42e123, lower.tail=T, log.p=F)
-[1]   1   0   0   0   1   1 NaN
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 0.13e-8, 1, lower.tail=F, log.p=T)
+[1]  -0.9327521 -44.8239272        -Inf        -Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(33e123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42e123, lower.tail=T, log.p=T)
-[1]    0 -Inf -Inf -Inf    0    0  NaN
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 0.13e-8, 1, lower.tail=T, log.p=F)
+[1] 0.6065307 1.0000000 1.0000000 1.0000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(42, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42, lower.tail=F, log.p=F)
-[1]   0   1   1   1   1   0 NaN
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 0.13e-8, 1, lower.tail=T, log.p=T)
+[1] -5.000000e-01 -3.413625e-20  0.000000e+00  0.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(42, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42, lower.tail=F, log.p=T)
-[1] -1.764e+03  0.000e+00  0.000e+00  0.000e+00 -1.764e-29       -Inf        NaN
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 1, 0.13e-8, lower.tail=F, log.p=F)
+[1] 9.999948e-01 1.523971e-23 0.000000e+00 0.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(42, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42, lower.tail=T, log.p=F)
-[1] 1.000e+00 0.000e+00 0.000e+00 0.000e+00 1.764e-29 1.000e+00       NaN
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 1, 0.13e-8, lower.tail=F, log.p=T)
+[1] -5.170896e-06 -5.253814e+01          -Inf          -Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pexp(c(42, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42, lower.tail=T, log.p=T)
-[1]   0.00000      -Inf      -Inf      -Inf -66.20738   0.00000       NaN
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 1, 0.13e-8, lower.tail=T, log.p=F)
+[1] 5.170883e-06 1.000000e+00 1.000000e+00 1.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pgamma(0, -1,  scale=2)
-[1] NaN
-Warning message:
-In pgamma(0, -1, scale = 2) : NaNs produced
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 1, 0.13e-8, lower.tail=T, log.p=T)
+[1] -1.217247e+01 -1.523971e-23  0.000000e+00  0.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pgamma(0, -Inf,  scale=2)
-[1] NaN
-Warning message:
-In pgamma(0, -Inf, scale = 2) : NaNs produced
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 420, 4, lower.tail=F, log.p=F)
+[1] 1 1 0 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pgamma(0, 0,  scale=2)
-[1] 0
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 420, 4, lower.tail=F, log.p=T)
+[1]  0.000000e+00 -3.150394e-64          -Inf          -Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pgamma(0, 1, -1)
-[1] NaN
-Warning message:
-In pgamma(0, 1, -1) : NaNs produced
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 420, 4, lower.tail=T, log.p=F)
+[1] 0.000000e+00 3.150394e-64 1.000000e+00 1.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pgamma(0, 1, -Inf)
-[1] NaN
-Warning message:
-In pgamma(0, 1, -Inf) : NaNs produced
+#pchisq(c(0.42e-10, 100, 13e10, 11e111), 420, 4, lower.tail=T, log.p=T)
+[1] -6081.6502  -146.2179     0.0000     0.0000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pgamma(0, 1, 0)
+#pchisq(c(0.5, 2, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 1, 1, lower.tail=F, log.p=F)
+[1] 0.6590992 0.3472435 1.0000000 1.0000000 1.0000000 1.0000000 0.0000000
+[8]       NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pchisq(c(0.5, 2, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 1, 1, lower.tail=F, log.p=T)
+[1] -4.168812e-01 -1.057729e+00  0.000000e+00  0.000000e+00  0.000000e+00
+[6] -3.136299e-16          -Inf           NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pchisq(c(0.5, 2, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 1, 1, lower.tail=T, log.p=F)
+[1] 3.409008e-01 6.527565e-01 0.000000e+00 0.000000e+00 0.000000e+00
+[6] 3.136299e-16 1.000000e+00          NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pchisq(c(0.5, 2, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 1, 1, lower.tail=T, log.p=T)
+[1]  -1.0761638  -0.4265511        -Inf        -Inf        -Inf -35.6983180
+[7]   0.0000000         NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(0, -1)
+[1] NaN
+Warning message:
+In pexp(0, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(0, -Inf)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(0, 0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(0, Inf)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(0, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(10, -10, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 13e-20, lower.tail=F, log.p=F)
+[1]   1   1   1   1   1   1   0 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(10, -10, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 13e-20, lower.tail=F, log.p=T)
+[1] -1.30e-18  0.00e+00  0.00e+00  0.00e+00  0.00e+00 -5.46e-50      -Inf
+[8]       NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(10, -10, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 13e-20, lower.tail=T, log.p=F)
+[1] 1.30e-18 0.00e+00 0.00e+00 0.00e+00 0.00e+00 5.46e-50 1.00e+00      NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(10, -10, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 13e-20, lower.tail=T, log.p=T)
+[1]  -41.18417       -Inf       -Inf       -Inf       -Inf -113.43181    0.00000
+[8]        NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(33e123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42e123, lower.tail=F, log.p=F)
+[1]   0   1   1   1   0   0 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(33e123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42e123, lower.tail=F, log.p=T)
+[1] -1.386e+249   0.000e+00   0.000e+00   0.000e+00  -1.764e+94        -Inf
+[7]         NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(33e123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42e123, lower.tail=T, log.p=F)
+[1]   1   0   0   0   1   1 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(33e123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42e123, lower.tail=T, log.p=T)
+[1]    0 -Inf -Inf -Inf    0    0  NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(42, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42, lower.tail=F, log.p=F)
+[1]   0   1   1   1   1   0 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(42, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42, lower.tail=F, log.p=T)
+[1] -1.764e+03  0.000e+00  0.000e+00  0.000e+00 -1.764e-29       -Inf        NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(42, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42, lower.tail=T, log.p=F)
+[1] 1.000e+00 0.000e+00 0.000e+00 0.000e+00 1.764e-29 1.000e+00       NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pexp(c(42, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 42, lower.tail=T, log.p=T)
+[1]   0.00000      -Inf      -Inf      -Inf -66.20738   0.00000       NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, -1,  5,  5)
+[1] NaN
+Warning message:
+In pf(0, -1, 5, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, -Inf,  5,  5)
+[1] NaN
+Warning message:
+In pf(0, -Inf, 5, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, 0,  5,  5)
+[1] NaN
+Warning message:
+In pf(0, 0, 5, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, 5,  5, -1)
+[1] NaN
+Warning message:
+In pf(0, 5, 5, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, 5,  5, -Inf)
+[1] NaN
+Warning message:
+In pf(0, 5, 5, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, 5,  5, 0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, 5,  5, Inf)
+[1] NaN
+Warning message:
+In pf(0, 5, 5, Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, 5,  5, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, 5, -1,  5)
+[1] NaN
+Warning message:
+In pf(0, 5, -1, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, 5, -Inf,  5)
+[1] NaN
+Warning message:
+In pf(0, 5, -Inf, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, 5, 0,  5)
+[1] NaN
+Warning message:
+In pf(0, 5, 0, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, 5, Inf,  5)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, 5, NaN,  5)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, Inf,  5,  5)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(0, NaN,  5,  5)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0.12e-10, 6, 31e10, lower.tail=F, log.p=F)
+ [1]   1   1   1   1   1   1   1   1   0 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0.12e-10, 6, 31e10, lower.tail=F, log.p=T)
+ [1]    0    0    0    0    0    0    0    0 -Inf  NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0.12e-10, 6, 31e10, lower.tail=T, log.p=F)
+ [1]   0   0   0   0   0   0   0   0   1 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0.12e-10, 6, 31e10, lower.tail=T, log.p=T)
+ [1] -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf    0  NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 0.12e-10, 5, lower.tail=F, log.p=F)
+ [1]   1   1   1   1   1   1   1   1   0 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 0.12e-10, 5, lower.tail=F, log.p=T)
+ [1] -4.342122e-11 -4.739038e-11 -4.994435e-11 -5.171639e-11  0.000000e+00
+ [6]  0.000000e+00  0.000000e+00 -2.523888e-60          -Inf           NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 0.12e-10, 5, lower.tail=T, log.p=F)
+ [1] 4.342122e-11 4.739038e-11 4.994435e-11 5.171639e-11 0.000000e+00
+ [6] 0.000000e+00 0.000000e+00 2.523888e-60 1.000000e+00          NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 0.12e-10, 5, lower.tail=T, log.p=T)
+ [1]  -23.86007  -23.77260  -23.72011  -23.68525       -Inf       -Inf
+ [7]       -Inf -137.22930    0.00000        NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 5, 5, lower.tail=F, log.p=F)
+ [1] 0.7960368423 0.0481532307 0.0018278022 0.0001527094 1.0000000000
+ [6] 1.0000000000 1.0000000000 1.0000000000 0.0000000000          NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 5, 5, lower.tail=F, log.p=T)
+ [1] -2.281098e-01 -3.033367e+00 -6.304641e+00 -8.786974e+00  0.000000e+00
+ [6]  0.000000e+00  0.000000e+00 -5.097836e-77          -Inf           NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 5, 5, lower.tail=T, log.p=F)
+ [1] 2.039632e-01 9.518468e-01 9.981722e-01 9.998473e-01 0.000000e+00
+ [6] 0.000000e+00 0.000000e+00 5.097836e-77 1.000000e+00          NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 5, 5, lower.tail=T, log.p=T)
+ [1] -1.589816e+00 -4.935121e-02 -1.829475e-03 -1.527211e-04          -Inf
+ [6]          -Inf          -Inf -1.756702e+02  0.000000e+00           NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 6, 0.12e-10, lower.tail=F, log.p=F)
+ [1] 4.894344e-01 7.119843e-03 1.191517e-04 5.854787e-06 1.000000e+00
+ [6] 1.000000e+00 1.000000e+00 1.000000e+00 0.000000e+00          NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 6, 0.12e-10, lower.tail=F, log.p=T)
+ [1] -7.145048e-01 -4.944870e+00 -9.035113e+00 -1.204825e+01  0.000000e+00
+ [6]  0.000000e+00  0.000000e+00 -5.707168e-76          -Inf           NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 6, 0.12e-10, lower.tail=T, log.p=F)
+ [1] 5.105656e-01 9.928802e-01 9.998808e-01 9.999941e-01 0.000000e+00
+ [6] 0.000000e+00 0.000000e+00 5.707168e-76 1.000000e+00          NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pf(c(1, 10, 44, 123, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 5, 6, 0.12e-10, lower.tail=T, log.p=T)
+ [1] -6.722361e-01 -7.145310e-03 -1.191588e-04 -5.854804e-06          -Inf
+ [6]          -Inf          -Inf -1.732547e+02  0.000000e+00           NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pgamma(0, -1,  scale=2)
+[1] NaN
+Warning message:
+In pgamma(0, -1, scale = 2) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pgamma(0, -Inf,  scale=2)
+[1] NaN
+Warning message:
+In pgamma(0, -Inf, scale = 2) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pgamma(0, 0,  scale=2)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pgamma(0, 1, -1)
+[1] NaN
+Warning message:
+In pgamma(0, 1, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pgamma(0, 1, -Inf)
+[1] NaN
+Warning message:
+In pgamma(0, 1, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pgamma(0, 1, 0)
 [1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
@@ -112349,109 +113247,301 @@ In pgamma(0, 1, Inf) : NaNs produced
 [1]    0    0 -Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(0, -Inf,  -1)
+#phyper(0, -10,  11,  4)
 [1] NaN
 Warning message:
-In pnorm(0, -Inf, -1) : NaNs produced
+In phyper(0, -10, 11, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(0, 0, -Inf)
+#phyper(0, -Inf,  11,  4)
 [1] NaN
 Warning message:
-In pnorm(0, 0, -Inf) : NaNs produced
+In phyper(0, -Inf, 11, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(0, 0, Inf)
-[1] 0.5
+#phyper(0, 0.3,  11,  4)
+[1] 1
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(0, 0, NaN)
+#phyper(0, 7,  11, -10)
 [1] NaN
+Warning message:
+In phyper(0, 7, 11, -10) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(0, Inf,  -1)
+#phyper(0, 7,  11, -Inf)
 [1] NaN
 Warning message:
-In pnorm(0, Inf, -1) : NaNs produced
+In phyper(0, 7, 11, -Inf) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(0, NaN,  -1)
-[1] NaN
+#phyper(0, 7,  11, 0.3)
+[1] 1
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(0), 0, -1, lower.tail=F, log.p=F)
+#phyper(0, 7,  11, Inf)
 [1] NaN
 Warning message:
-In pnorm(c(0), 0, -1, lower.tail = F, log.p = F) : NaNs produced
+In phyper(0, 7, 11, Inf) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(0), 0, -1, lower.tail=F, log.p=T)
+#phyper(0, 7,  11, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(0, 7, -10,  4)
 [1] NaN
 Warning message:
-In pnorm(c(0), 0, -1, lower.tail = F, log.p = T) : NaNs produced
+In phyper(0, 7, -10, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(0), 0, -1, lower.tail=T, log.p=F)
+#phyper(0, 7, -Inf,  4)
 [1] NaN
 Warning message:
-In pnorm(c(0), 0, -1, lower.tail = T, log.p = F) : NaNs produced
+In phyper(0, 7, -Inf, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(0), 0, -1, lower.tail=T, log.p=T)
+#phyper(0, 7, 0.3,  4)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(0, 7, Inf,  4)
 [1] NaN
 Warning message:
-In pnorm(c(0), 0, -1, lower.tail = T, log.p = T) : NaNs produced
+In phyper(0, 7, Inf, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, lower.tail=F, log.p=F)
-[1]   0   1   1   0   0   0 NaN
+#phyper(0, 7, NaN,  4)
+[1] NaN
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, lower.tail=F, log.p=T)
-[1] -Inf    0    0 -Inf -Inf -Inf  NaN
+#phyper(0, Inf,  11,  4)
+[1] NaN
+Warning message:
+In phyper(0, Inf, 11, 4) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, lower.tail=T, log.p=F)
-[1]   1   0   0   1   1   1 NaN
+#phyper(0, NaN,  11,  4)
+[1] NaN
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, lower.tail=T, log.p=T)
-[1]    0 -Inf -Inf    0    0    0  NaN
+#phyper(c(0.1, -Inf, Inf, 0.3e89), 5, 5, 5, lower.tail=F, log.p=F)
+[1] 0.9960317 1.0000000 0.0000000 0.0000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(4, -100, 0), 4, 4, lower.tail=F, log.p=F)
-[1] 0.5000000 1.0000000 0.8413447
+#phyper(c(0.1, -Inf, Inf, 0.3e89), 5, 5, 5, lower.tail=F, log.p=T)
+[1] -0.003976148  0.000000000         -Inf         -Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(4, -100, 0), 4, 4, lower.tail=F, log.p=T)
-[1]  -6.931472e-01 -2.476063e-149  -1.727538e-01
+#phyper(c(0.1, -Inf, Inf, 0.3e89), 5, 5, 5, lower.tail=T, log.p=F)
+[1] 0.003968254 0.000000000 1.000000000 1.000000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(4, -100, 0), 4, 4, lower.tail=T, log.p=F)
-[1]  5.000000e-01 2.476063e-149  1.586553e-01
+#phyper(c(0.1, -Inf, Inf, 0.3e89), 5, 5, 5, lower.tail=T, log.p=T)
+[1] -5.529429      -Inf  0.000000  0.000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#pnorm(c(4, -100, 0), 4, 4, lower.tail=T, log.p=T)
-[1]   -0.6931472 -342.1785089   -1.8410216
+#phyper(c(1, 2, 3, 4, 20, 12e12), 7, 11, 4, lower.tail=F, log.p=F)
+[1] 0.51470588 0.13725490 0.01143791 0.00000000 0.00000000 0.00000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#punif(0, -3, -Inf)
-[1] NaN
-Warning message:
-In punif(0, -3, -Inf) : NaNs produced
+#phyper(c(1, 2, 3, 4, 20, 12e12), 7, 11, 4, lower.tail=F, log.p=T)
+[1] -0.6641596 -1.9859155 -4.4708221       -Inf       -Inf       -Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#punif(0, -3, Inf)
-[1] NaN
-Warning message:
-In punif(0, -3, Inf) : NaNs produced
+#phyper(c(1, 2, 3, 4, 20, 12e12), 7, 11, 4, lower.tail=T, log.p=F)
+[1] 0.4852941 0.8627451 0.9885621 1.0000000 1.0000000 1.0000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#punif(0, -3, NaN)
-[1] NaN
+#phyper(c(1, 2, 3, 4, 20, 12e12), 7, 11, 4, lower.tail=T, log.p=T)
+[1] -0.72300014 -0.14763600 -0.01150382  0.00000000  0.00000000  0.00000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#punif(0, -Inf,  3.3)
+#phyper(c(1, 2, 3, 4, 20, 12e12), 7e12, 11, 4, lower.tail=F, log.p=F)
+[1] 1 1 1 0 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(1, 2, 3, 4, 20, 12e12), 7e12, 11, 4, lower.tail=F, log.p=T)
+[1] -1.154519e-35 -1.346939e-23 -6.285714e-12          -Inf          -Inf
+[6]          -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(1, 2, 3, 4, 20, 12e12), 7e12, 11, 4, lower.tail=T, log.p=F)
+[1] 1.154519e-35 1.346939e-23 6.285714e-12 1.000000e+00 1.000000e+00
+[6] 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(1, 2, 3, 4, 20, 12e12), 7e12, 11, 4, lower.tail=T, log.p=T)
+[1] -80.44679 -52.66162 -25.79274   0.00000   0.00000   0.00000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(1, 2, 3, 4, 5, 6, 7, 8, 11, 20, 12e12), 7, 11, 12, lower.tail=F, log.p=F)
+ [1] 0.99962293 0.98717949 0.88348416 0.57239819 0.19909502 0.02488688
+ [7] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(1, 2, 3, 4, 5, 6, 7, 8, 11, 20, 12e12), 7, 11, 12, lower.tail=F, log.p=T)
+ [1] -0.000377145 -0.012903405 -0.123881913 -0.557920393 -1.613973068
+ [6] -3.693414609         -Inf         -Inf         -Inf         -Inf
+[11]         -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(1, 2, 3, 4, 5, 6, 7, 8, 11, 20, 12e12), 7, 11, 12, lower.tail=T, log.p=F)
+ [1] 0.0003770739 0.0128205128 0.1165158371 0.4276018100 0.8009049774
+ [6] 0.9751131222 1.0000000000 1.0000000000 1.0000000000 1.0000000000
+[11] 1.0000000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(1, 2, 3, 4, 5, 6, 7, 8, 11, 20, 12e12), 7, 11, 12, lower.tail=T, log.p=T)
+ [1] -7.88306935 -4.35670883 -2.14972807 -0.84956287 -0.22201297 -0.02520179
+ [7]  0.00000000  0.00000000  0.00000000  0.00000000  0.00000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(1, 2, 3, 7, 20, 12e12), 11, 7e12, 7, lower.tail=F, log.p=F)
+[1] 4.714286e-23 1.010204e-34 1.154519e-46 0.000000e+00 0.000000e+00
+[6] 0.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(1, 2, 3, 7, 20, 12e12), 11, 7e12, 7, lower.tail=F, log.p=T)
+[1]  -51.40886  -78.27774 -105.77523       -Inf       -Inf       -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(1, 2, 3, 7, 20, 12e12), 11, 7e12, 7, lower.tail=T, log.p=F)
+[1] 1 1 1 1 1 1
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(1, 2, 3, 7, 20, 12e12), 11, 7e12, 7, lower.tail=T, log.p=T)
+[1] -4.714286e-23 -1.010204e-34 -1.154519e-46  0.000000e+00  0.000000e+00
+[6]  0.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(2), 3, 4, 10, lower.tail=F, log.p=F)
+[1] NaN
+Warning message:
+In phyper(c(2), 3, 4, 10, lower.tail = F, log.p = F) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(2), 3, 4, 10, lower.tail=F, log.p=T)
+[1] NaN
+Warning message:
+In phyper(c(2), 3, 4, 10, lower.tail = F, log.p = T) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(2), 3, 4, 10, lower.tail=T, log.p=F)
+[1] NaN
+Warning message:
+In phyper(c(2), 3, 4, 10, lower.tail = T, log.p = F) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#phyper(c(2), 3, 4, 10, lower.tail=T, log.p=T)
+[1] NaN
+Warning message:
+In phyper(c(2), 3, 4, 10, lower.tail = T, log.p = T) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(0, -Inf,  -1)
+[1] NaN
+Warning message:
+In pnorm(0, -Inf, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(0, 0, -Inf)
+[1] NaN
+Warning message:
+In pnorm(0, 0, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(0, 0, Inf)
+[1] 0.5
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(0, 0, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(0, Inf,  -1)
+[1] NaN
+Warning message:
+In pnorm(0, Inf, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(0, NaN,  -1)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(0), 0, -1, lower.tail=F, log.p=F)
+[1] NaN
+Warning message:
+In pnorm(c(0), 0, -1, lower.tail = F, log.p = F) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(0), 0, -1, lower.tail=F, log.p=T)
+[1] NaN
+Warning message:
+In pnorm(c(0), 0, -1, lower.tail = F, log.p = T) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(0), 0, -1, lower.tail=T, log.p=F)
+[1] NaN
+Warning message:
+In pnorm(c(0), 0, -1, lower.tail = T, log.p = F) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(0), 0, -1, lower.tail=T, log.p=T)
+[1] NaN
+Warning message:
+In pnorm(c(0), 0, -1, lower.tail = T, log.p = T) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, lower.tail=F, log.p=F)
+[1]   0   1   1   0   0   0 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, lower.tail=F, log.p=T)
+[1] -Inf    0    0 -Inf -Inf -Inf  NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, lower.tail=T, log.p=F)
+[1]   1   0   0   1   1   1 NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(1, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), 0, 0, lower.tail=T, log.p=T)
+[1]    0 -Inf -Inf    0    0    0  NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(4, -100, 0), 4, 4, lower.tail=F, log.p=F)
+[1] 0.5000000 1.0000000 0.8413447
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(4, -100, 0), 4, 4, lower.tail=F, log.p=T)
+[1]  -6.931472e-01 -2.476063e-149  -1.727538e-01
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(4, -100, 0), 4, 4, lower.tail=T, log.p=F)
+[1]  5.000000e-01 2.476063e-149  1.586553e-01
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#pnorm(c(4, -100, 0), 4, 4, lower.tail=T, log.p=T)
+[1]   -0.6931472 -342.1785089   -1.8410216
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#punif(0, -3, -Inf)
+[1] NaN
+Warning message:
+In punif(0, -3, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#punif(0, -3, Inf)
+[1] NaN
+Warning message:
+In punif(0, -3, Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#punif(0, -3, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#punif(0, -Inf,  3.3)
 [1] NaN
 Warning message:
 In punif(0, -Inf, 3.3) : NaNs produced
@@ -112471,456 +113561,974 @@ In punif(0, Inf, 3.3) : NaNs produced
 [1] 1.0000000 0.2063492 0.0000000 1.0000000 0.5238095 0.5238095 0.5238095
 [8] 0.0000000       NaN
 
-##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#punif(c(-3, 2, 3.3, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), -3, 3.3, lower.tail=F, log.p=T)
-[1]  0.0000000 -1.5781854       -Inf  0.0000000 -0.6466272 -0.6466272 -0.6466272
-[8]       -Inf        NaN
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#punif(c(-3, 2, 3.3, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), -3, 3.3, lower.tail=F, log.p=T)
+[1]  0.0000000 -1.5781854       -Inf  0.0000000 -0.6466272 -0.6466272 -0.6466272
+[8]       -Inf        NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#punif(c(-3, 2, 3.3, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), -3, 3.3, lower.tail=T, log.p=F)
+[1] 0.0000000 0.7936508 1.0000000 0.0000000 0.4761905 0.4761905 0.4761905
+[8] 1.0000000       NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
+#punif(c(-3, 2, 3.3, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), -3, 3.3, lower.tail=T, log.p=T)
+[1]       -Inf -0.2311117  0.0000000       -Inf -0.7419373 -0.7419373 -0.7419373
+[8]  0.0000000        NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(-0.42e-38, 0.5, 0.5)
+[1] NaN
+Warning message:
+In qbeta(-4.2e-39, 0.5, 0.5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(-0.42e-38, 10, 15, 0)
+[1] NaN
+Warning message:
+In qbeta(-4.2e-39, 10, 15, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(-42, 0.5, 0.5)
+[1] NaN
+Warning message:
+In qbeta(-42, 0.5, 0.5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(-42, 10, 15, 0)
+[1] NaN
+Warning message:
+In qbeta(-42, 10, 15, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(-Inf, 0.5, 0.5)
+[1] NaN
+Warning message:
+In qbeta(-Inf, 0.5, 0.5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(-Inf, 10, 15, 0)
+[1] NaN
+Warning message:
+In qbeta(-Inf, 10, 15, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, -1,  0.5)
+[1] NaN
+Warning message:
+In qbeta(0, -1, 0.5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, -4,  15,  0)
+[1] NaN
+Warning message:
+In qbeta(0, -4, 15, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, -Inf,  0.5)
+[1] NaN
+Warning message:
+In qbeta(0, -Inf, 0.5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, -Inf,  15,  0)
+[1] NaN
+Warning message:
+In qbeta(0, -Inf, 15, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 0,  0.5)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 0,  15,  0)
+[1] NaN
+Warning message:
+In qbeta(0, 0, 15, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 0.5, -1)
+[1] NaN
+Warning message:
+In qbeta(0, 0.5, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 0.5, -Inf)
+[1] NaN
+Warning message:
+In qbeta(0, 0.5, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 0.5, 0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 0.5, Inf)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 0.5, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 10,  15, -4)
+[1] NaN
+Warning message:
+In qbeta(0, 10, 15, -4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 10,  15, -Inf)
+[1] NaN
+Warning message:
+In qbeta(0, 10, 15, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 10,  15, 0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 10,  15, Inf)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 10,  15, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 10, -4,  0)
+[1] NaN
+Warning message:
+In qbeta(0, 10, -4, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 10, -Inf,  0)
+[1] NaN
+Warning message:
+In qbeta(0, 10, -Inf, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 10, 0,  0)
+[1] NaN
+Warning message:
+In qbeta(0, 10, 0, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 10, Inf,  0)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, 10, NaN,  0)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, Inf,  0.5)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, Inf,  15,  0)
+[1] NaN
+Warning message:
+In qbeta(0, Inf, 15, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, NaN,  0.5)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(0, NaN,  15,  0)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(Inf, 0.5, 0.5)
+[1] NaN
+Warning message:
+In qbeta(Inf, 0.5, 0.5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(Inf, 10, 15, 0)
+[1] NaN
+Warning message:
+In qbeta(Inf, 10, 15, 0) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(NaN, 0.5, 0.5)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(NaN, 10, 15, 0)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, 0, lower.tail=F, log.p=F)
+[1] 1.0 0.0 0.0 0.5 1.0 0.0 0.0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, 0, lower.tail=T, log.p=F)
+[1] 0.0 0.0 0.0 0.5 1.0 1.0 1.0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, Inf, lower.tail=F, log.p=F)
+[1] 1 0 0 0 0 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, Inf, lower.tail=T, log.p=F)
+[1] 0 0 0 0 0 1 1
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.1, 3, lower.tail=F, log.p=F)
+[1] 1.000000e+00 1.000000e+00 9.839300e-02 2.312399e-04 1.397635e-06
+[6] 0.000000e+00 0.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.1, 3, lower.tail=T, log.p=F)
+[1] 0.000000e+00 0.000000e+00 2.366901e-11 2.312399e-04 6.768603e-03
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.5, 0.5, lower.tail=F, log.p=F)
+[1] 1.0000000 1.0000000 0.9755283 0.5000000 0.2061074 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.5, 0.5, lower.tail=T, log.p=F)
+[1]  0.000000e+00 4.352496e-157  2.447174e-02  5.000000e-01  7.938926e-01
+[6]  1.000000e+00  1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 10, 15, 0, lower.tail=F, log.p=F)
+[1] 1.0000000 1.0000000 0.5264118 0.3972924 0.3463781 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 10, 15, 0, lower.tail=T, log.p=F)
+[1] 0.000000e+00 3.412491e-09 2.772130e-01 3.972924e-01 4.497463e-01
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 2, 5, lower.tail=F, log.p=F)
+[1] 1.0000000 1.0000000 0.5103163 0.2644500 0.1818035 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 2, 5, lower.tail=T, log.p=F)
+[1] 0.000000e+00 1.673320e-40 9.259526e-02 2.644500e-01 3.603577e-01
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 6, 3, lower.tail=F, log.p=F)
+[1] 1.0000000 1.0000000 0.8531451 0.6794810 0.5925411 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 6, 3, lower.tail=T, log.p=F)
+[1] 0.000000e+00 4.966097e-14 4.617846e-01 6.794810e-01 7.586657e-01
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7, 11, 0.37e-10, lower.tail=F, log.p=F)
+[1] 1.0000000 1.0000000 0.5373549 0.3846872 0.3251782 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7, 11, 0.37e-10, lower.tail=T, log.p=F)
+[1] 0.000000e+00 1.551047e-12 2.461368e-01 3.846872e-01 4.466173e-01
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7, 113e11, 1, lower.tail=F, log.p=F)
+[1] 1.000000e+00 1.000000e+00 9.979557e-13 6.326635e-13 5.134397e-13
+[6] 0.000000e+00 0.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7, 113e11, 1, lower.tail=T, log.p=F)
+[1] 0.000000e+00 2.042740e-24 3.697562e-13 6.326635e-13 7.690718e-13
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7, 13, 3, lower.tail=F, log.p=F)
+[1] 1.0000000 1.0000000 0.5361327 0.3904742 0.3326837 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7, 13, 3, lower.tail=T, log.p=F)
+[1] 0.000000e+00 1.677349e-12 2.547294e-01 3.904742e-01 4.499427e-01
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), Inf, 0, lower.tail=F, log.p=F)
+[1] 1 1 1 1 1 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), Inf, 0, lower.tail=T, log.p=F)
+[1] 0 1 1 1 1 1 1
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, 0, lower.tail=F, log.p=T)
+[1] 1.0 0.0 0.0 0.5 1.0 0.0 0.0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, 0, lower.tail=T, log.p=T)
+[1] 0.0 0.0 0.0 0.5 1.0 1.0 1.0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, Inf, lower.tail=F, log.p=T)
+[1] 1 0 0 0 0 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, Inf, lower.tail=T, log.p=T)
+[1] 0 0 0 0 0 1 1
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.1, 3, lower.tail=F, log.p=T)
+[1] 1.000000e+00 1.000000e+00 9.839300e-02 2.312399e-04 1.397635e-06
+[6] 0.000000e+00 0.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.1, 3, lower.tail=T, log.p=T)
+[1]  0.000000e+00 1.112537e-308  2.366901e-11  2.312399e-04  6.768603e-03
+[6]  1.000000e+00  1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.5, 0.5, lower.tail=F, log.p=T)
+[1] 1.0000000 1.0000000 0.9755283 0.5000000 0.2061074 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.5, 0.5, lower.tail=T, log.p=T)
+[1]  0.000000e+00 4.352496e-157  2.447174e-02  5.000000e-01  7.938926e-01
+[6]  1.000000e+00  1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 10, 15, 0, lower.tail=F, log.p=T)
+[1] 1.0000000 1.0000000 0.5264118 0.3972924 0.3463781 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 10, 15, 0, lower.tail=T, log.p=T)
+[1] 0.000000e+00 3.412491e-09 2.772130e-01 3.972924e-01 4.497463e-01
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 2, 5, lower.tail=F, log.p=T)
+[1] 1.0000000 1.0000000 0.5103163 0.2644500 0.1818035 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 2, 5, lower.tail=T, log.p=T)
+[1] 0.000000e+00 1.673320e-40 9.259526e-02 2.644500e-01 3.603577e-01
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 6, 3, lower.tail=F, log.p=T)
+[1] 1.0000000 1.0000000 0.8531451 0.6794810 0.5925411 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 6, 3, lower.tail=T, log.p=T)
+[1] 0.000000e+00 4.966097e-14 4.617846e-01 6.794810e-01 7.586657e-01
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7, 11, 0.37e-10, lower.tail=F, log.p=T)
+[1] 1.0000000 1.0000000 0.5373549 0.3846872 0.3251782 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7, 11, 0.37e-10, lower.tail=T, log.p=T)
+[1] 0.000000e+00 1.551047e-12 2.461368e-01 3.846872e-01 4.466173e-01
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7, 113e11, 1, lower.tail=F, log.p=T)
+[1] 1.000000e+00 1.000000e+00 9.979557e-13 6.326635e-13 5.134397e-13
+[6] 0.000000e+00 0.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7, 113e11, 1, lower.tail=T, log.p=T)
+[1] 0.000000e+00 2.042740e-24 3.697562e-13 6.326635e-13 7.690718e-13
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7, 13, 3, lower.tail=F, log.p=T)
+[1] 1.0000000 1.0000000 0.5361327 0.3904742 0.3326837 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7, 13, 3, lower.tail=T, log.p=T)
+[1] 0.000000e+00 1.677349e-12 2.547294e-01 3.904742e-01 4.499427e-01
+[6] 1.000000e+00 1.000000e+00
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), Inf, 0, lower.tail=F, log.p=T)
+[1] 1 1 1 1 1 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), Inf, 0, lower.tail=T, log.p=T)
+[1] 0 1 1 1 1 1 1
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(-0.42e-38, 0, -1)
+[1] NaN
+Warning message:
+In qcauchy(-4.2e-39, 0, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(-42, 0, -1)
+[1] NaN
+Warning message:
+In qcauchy(-42, 0, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(-Inf, 0, -1)
+[1] NaN
+Warning message:
+In qcauchy(-Inf, 0, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(0, -Inf,  -1)
+[1] NaN
+Warning message:
+In qcauchy(0, -Inf, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(0, 0, -Inf)
+[1] NaN
+Warning message:
+In qcauchy(0, 0, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(0, 0, Inf)
+[1] NaN
+Warning message:
+In qcauchy(0, 0, Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(0, 0, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(0, Inf,  -1)
+[1] NaN
+Warning message:
+In qcauchy(0, Inf, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(0, NaN,  -1)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(Inf, 0, -1)
+[1] NaN
+Warning message:
+In qcauchy(Inf, 0, -1) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(NaN, 0, -1)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), -0.01, 0.03, lower.tail=F, log.p=F)
+[1]           Inf  2.273642e+76  8.233051e-02 -1.000000e-02 -3.179628e-02
+[6]          -Inf          -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), -0.01, 0.03, lower.tail=T, log.p=F)
+[1]          -Inf -2.273642e+76 -1.023305e-01 -1.000000e-02  1.179628e-02
+[6]           Inf           Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), -5, 5, lower.tail=F, log.p=F)
+[1]           Inf  3.789403e+78  1.038842e+01 -5.000000e+00 -8.632713e+00
+[6]          -Inf          -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), -5, 5, lower.tail=T, log.p=F)
+[1]          -Inf -3.789403e+78 -2.038842e+01 -5.000000e+00 -1.367287e+00
+[6]           Inf           Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, -1, lower.tail=F, log.p=F)
+[1] NaN NaN NaN NaN NaN NaN NaN
+Warning message:
+In qcauchy(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1), 0, -1,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, -1, lower.tail=T, log.p=F)
+[1] NaN NaN NaN NaN NaN NaN NaN
+Warning message:
+In qcauchy(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1), 0, -1,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), -0.01, 0.03, lower.tail=F, log.p=T)
+[1]           Inf  2.273642e+76  8.233051e-02 -1.000000e-02 -3.179628e-02
+[6]          -Inf          -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), -0.01, 0.03, lower.tail=T, log.p=T)
+[1]          -Inf -2.273642e+76 -1.023305e-01 -1.000000e-02  1.179628e-02
+[6]           Inf           Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), -5, 5, lower.tail=F, log.p=T)
+[1]           Inf  3.789403e+78  1.038842e+01 -5.000000e+00 -8.632713e+00
+[6]          -Inf          -Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), -5, 5, lower.tail=T, log.p=T)
+[1]          -Inf -3.789403e+78 -2.038842e+01 -5.000000e+00 -1.367287e+00
+[6]           Inf           Inf
 
-##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#punif(c(-3, 2, 3.3, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), -3, 3.3, lower.tail=T, log.p=F)
-[1] 0.0000000 0.7936508 1.0000000 0.0000000 0.4761905 0.4761905 0.4761905
-[8] 1.0000000       NaN
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, -1, lower.tail=F, log.p=T)
+[1] NaN NaN NaN NaN NaN NaN NaN
+Warning message:
+In qcauchy(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 0,  :
+  NaNs produced
 
-##com.oracle.truffle.r.test.library.stats.TestDistributions.testDistributionFunctions#Output.MayIgnoreWarningContext#
-#punif(c(-3, 2, 3.3, -Inf, -0.42e-30, 0, 0.42e-30, Inf, NaN), -3, 3.3, lower.tail=T, log.p=T)
-[1]       -Inf -0.2311117  0.0000000       -Inf -0.7419373 -0.7419373 -0.7419373
-[8]  0.0000000        NaN
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, -1, lower.tail=T, log.p=T)
+[1] NaN NaN NaN NaN NaN NaN NaN
+Warning message:
+In qcauchy(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 0,  :
+  NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(-0.42e-38, 0.5, 0.5)
+#qchisq(-0.42e-38, 1, 1)
 [1] NaN
 Warning message:
-In qbeta(-4.2e-39, 0.5, 0.5) : NaNs produced
+In qchisq(-4.2e-39, 1, 1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(-42, 0.5, 0.5)
+#qchisq(-42, 1, 1)
 [1] NaN
 Warning message:
-In qbeta(-42, 0.5, 0.5) : NaNs produced
+In qchisq(-42, 1, 1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(-Inf, 0.5, 0.5)
+#qchisq(-Inf, 1, 1)
 [1] NaN
 Warning message:
-In qbeta(-Inf, 0.5, 0.5) : NaNs produced
+In qchisq(-Inf, 1, 1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(0, -1,  0.5)
+#qchisq(0, -3,  1)
 [1] NaN
 Warning message:
-In qbeta(0, -1, 0.5) : NaNs produced
+In qchisq(0, -3, 1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(0, -Inf,  0.5)
+#qchisq(0, -Inf,  1)
 [1] NaN
 Warning message:
-In qbeta(0, -Inf, 0.5) : NaNs produced
+In qchisq(0, -Inf, 1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(0, 0,  0.5)
+#qchisq(0, 0,  1)
 [1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(0, 0.5, -1)
+#qchisq(0, 1, -3)
 [1] NaN
 Warning message:
-In qbeta(0, 0.5, -1) : NaNs produced
+In qchisq(0, 1, -3) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(0, 0.5, -Inf)
+#qchisq(0, 1, -Inf)
 [1] NaN
 Warning message:
-In qbeta(0, 0.5, -Inf) : NaNs produced
+In qchisq(0, 1, -Inf) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(0, 0.5, 0)
+#qchisq(0, 1, 0)
 [1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(0, 0.5, Inf)
+#qchisq(0, 1, Inf)
 [1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(0, 0.5, NaN)
+#qchisq(0, 1, NaN)
 [1] NaN
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(0, Inf,  0.5)
-[1] 0
+#qchisq(0, Inf,  1)
+[1] NaN
+Warning message:
+In qchisq(0, Inf, 1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(0, NaN,  0.5)
+#qchisq(0, NaN,  1)
 [1] NaN
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(Inf, 0.5, 0.5)
+#qchisq(Inf, 1, 1)
 [1] NaN
 Warning message:
-In qbeta(Inf, 0.5, 0.5) : NaNs produced
+In qchisq(Inf, 1, 1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(NaN, 0.5, 0.5)
+#qchisq(NaN, 1, 1)
 [1] NaN
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, 0, lower.tail=F, log.p=F)
-[1] 1.0 0.0 0.0 0.5 1.0 0.0 0.0
-
-##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, 0, lower.tail=T, log.p=F)
-[1] 0.0 0.0 0.0 0.5 1.0 1.0 1.0
-
-##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, Inf, lower.tail=F, log.p=F)
-[1] 1 0 0 0 0 0 0
-
-##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, Inf, lower.tail=T, log.p=F)
-[1] 0 0 0 0 0 1 1
-
-##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.1, 3, lower.tail=F, log.p=F)
-[1] 1.000000e+00 1.000000e+00 9.839300e-02 2.312399e-04 1.397635e-06
-[6] 0.000000e+00 0.000000e+00
-
-##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.1, 3, lower.tail=T, log.p=F)
-[1] 0.000000e+00 0.000000e+00 2.366901e-11 2.312399e-04 6.768603e-03
-[6] 1.000000e+00 1.000000e+00
+#qchisq(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.13e-8, 1, lower.tail=F, log.p=F)
+[1]           Inf  3.884902e+02  3.497948e+00 1.948256e-308 2.185051e-308
+[6]  0.000000e+00  0.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.5, 0.5, lower.tail=F, log.p=F)
-[1] 1.0000000 1.0000000 0.9755283 0.5000000 0.2061074 0.0000000 0.0000000
+#qchisq(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.13e-8, 1, lower.tail=T, log.p=F)
+[1]  0.000000e+00 1.483383e-308 1.540690e-308 1.948256e-308  7.012971e-01
+[6]           Inf           Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.5, 0.5, lower.tail=T, log.p=F)
-[1]  0.000000e+00 4.352496e-157  2.447174e-02  5.000000e-01  7.938926e-01
-[6]  1.000000e+00  1.000000e+00
+#qchisq(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 1, 0.13e-8, lower.tail=F, log.p=F)
+[1]         Inf 354.6100738   2.7055435   0.4549364   0.1484719   0.0000000
+[7]   0.0000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 2, 5, lower.tail=F, log.p=F)
-[1] 1.0000000 1.0000000 0.5103163 0.2644500 0.1818035 0.0000000 0.0000000
+#qchisq(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 1, 0.13e-8, lower.tail=T, log.p=F)
+[1]  0.000000e+00 2.770885e-157  1.579077e-02  4.549364e-01  1.074194e+00
+[6]           Inf           Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 2, 5, lower.tail=T, log.p=F)
-[1] 0.000000e+00 1.673320e-40 9.259526e-02 2.644500e-01 3.603577e-01
-[6] 1.000000e+00 1.000000e+00
+#qchisq(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 1, 1, lower.tail=F, log.p=F)
+[1]         Inf 391.6893093   5.2187941   1.1036433   0.3860691   0.0000000
+[7]   0.0000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 6, 3, lower.tail=F, log.p=F)
-[1] 1.0000000 1.0000000 0.8531451 0.6794810 0.5925411 0.0000000 0.0000000
+#qchisq(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 1, 1, lower.tail=T, log.p=F)
+[1]  0.000000e+00 7.532046e-157  4.270125e-02  1.103643e+00  2.372806e+00
+[6]           Inf           Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 6, 3, lower.tail=T, log.p=F)
-[1] 0.000000e+00 4.966097e-14 4.617846e-01 6.794810e-01 7.586657e-01
-[6] 1.000000e+00 1.000000e+00
+#qchisq(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 420, 4, lower.tail=F, log.p=F)
+[1]       Inf 1232.0142  461.9006  423.3273  408.1833    0.0000    0.0000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), Inf, 0, lower.tail=F, log.p=F)
-[1] 1 1 1 1 1 0 0
+#qchisq(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 420, 4, lower.tail=T, log.p=F)
+[1]   0.00000  81.30876 386.96380 423.32729 438.84130       Inf       Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), Inf, 0, lower.tail=T, log.p=F)
-[1] 0 1 1 1 1 1 1
+#qchisq(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.13e-8, 1, lower.tail=F, log.p=T)
+[1]           Inf  3.884902e+02  3.497948e+00 1.948256e-308 2.185051e-308
+[6]  0.000000e+00  0.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, 0, lower.tail=F, log.p=T)
-[1] 1.0 0.0 0.0 0.5 1.0 0.0 0.0
+#qchisq(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.13e-8, 1, lower.tail=T, log.p=T)
+[1]  0.000000e+00 1.483383e-308 1.540690e-308 1.948256e-308  7.012971e-01
+[6]           Inf           Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, 0, lower.tail=T, log.p=T)
-[1] 0.0 0.0 0.0 0.5 1.0 1.0 1.0
+#qchisq(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 1, 0.13e-8, lower.tail=F, log.p=T)
+[1]         Inf 354.6100738   2.7055435   0.4549364   0.1484719   0.0000000
+[7]   0.0000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, Inf, lower.tail=F, log.p=T)
-[1] 1 0 0 0 0 0 0
+#qchisq(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 1, 0.13e-8, lower.tail=T, log.p=T)
+[1]  0.000000e+00 2.770885e-157  1.579077e-02  4.549364e-01  1.074194e+00
+[6]           Inf           Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, Inf, lower.tail=T, log.p=T)
-[1] 0 0 0 0 0 1 1
+#qchisq(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 1, 1, lower.tail=F, log.p=T)
+[1]         Inf 391.6893093   5.2187941   1.1036433   0.3860691   0.0000000
+[7]   0.0000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.1, 3, lower.tail=F, log.p=T)
-[1] 1.000000e+00 1.000000e+00 9.839300e-02 2.312399e-04 1.397635e-06
-[6] 0.000000e+00 0.000000e+00
+#qchisq(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 1, 1, lower.tail=T, log.p=T)
+[1]  0.000000e+00 7.532046e-157  4.270125e-02  1.103643e+00  2.372806e+00
+[6]           Inf           Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.1, 3, lower.tail=T, log.p=T)
-[1]  0.000000e+00 1.112537e-308  2.366901e-11  2.312399e-04  6.768603e-03
-[6]  1.000000e+00  1.000000e+00
+#qchisq(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 420, 4, lower.tail=F, log.p=T)
+[1]       Inf 1232.0142  461.9006  423.3273  408.1833    0.0000    0.0000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.5, 0.5, lower.tail=F, log.p=T)
-[1] 1.0000000 1.0000000 0.9755283 0.5000000 0.2061074 0.0000000 0.0000000
+#qchisq(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 420, 4, lower.tail=T, log.p=T)
+[1]   0.00000  81.30876 386.96380 423.32729 438.84130       Inf       Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.5, 0.5, lower.tail=T, log.p=T)
-[1]  0.000000e+00 4.352496e-157  2.447174e-02  5.000000e-01  7.938926e-01
-[6]  1.000000e+00  1.000000e+00
+#qexp(-0.42e-38, 13e-20)
+[1] NaN
+Warning message:
+In qexp(-4.2e-39, 1.3e-19) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 2, 5, lower.tail=F, log.p=T)
-[1] 1.0000000 1.0000000 0.5103163 0.2644500 0.1818035 0.0000000 0.0000000
+#qexp(-42, 13e-20)
+[1] NaN
+Warning message:
+In qexp(-42, 1.3e-19) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 2, 5, lower.tail=T, log.p=T)
-[1] 0.000000e+00 1.673320e-40 9.259526e-02 2.644500e-01 3.603577e-01
-[6] 1.000000e+00 1.000000e+00
+#qexp(-Inf, 13e-20)
+[1] NaN
+Warning message:
+In qexp(-Inf, 1.3e-19) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 6, 3, lower.tail=F, log.p=T)
-[1] 1.0000000 1.0000000 0.8531451 0.6794810 0.5925411 0.0000000 0.0000000
+#qexp(0, -1)
+[1] NaN
+Warning message:
+In qexp(0, -1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 6, 3, lower.tail=T, log.p=T)
-[1] 0.000000e+00 4.966097e-14 4.617846e-01 6.794810e-01 7.586657e-01
-[6] 1.000000e+00 1.000000e+00
+#qexp(0, -Inf)
+[1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), Inf, 0, lower.tail=F, log.p=T)
-[1] 1 1 1 1 1 0 0
+#qexp(0, 0)
+[1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qbeta(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), Inf, 0, lower.tail=T, log.p=T)
-[1] 0 1 1 1 1 1 1
+#qexp(0, Inf)
+[1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(-0.42e-38, 0, -1)
+#qexp(0, NaN)
 [1] NaN
-Warning message:
-In qcauchy(-4.2e-39, 0, -1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(-42, 0, -1)
+#qexp(Inf, 13e-20)
 [1] NaN
 Warning message:
-In qcauchy(-42, 0, -1) : NaNs produced
+In qexp(Inf, 1.3e-19) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(-Inf, 0, -1)
+#qexp(NaN, 13e-20)
 [1] NaN
-Warning message:
-In qcauchy(-Inf, 0, -1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(0, -Inf,  -1)
-[1] NaN
-Warning message:
-In qcauchy(0, -Inf, -1) : NaNs produced
+#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 13e-20, lower.tail=F, log.p=F)
+[1]          Inf 1.388224e+21 1.771219e+19 5.331901e+18 2.743653e+18
+[6] 0.000000e+00 0.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(0, 0, -Inf)
-[1] NaN
-Warning message:
-In qcauchy(0, 0, -Inf) : NaNs produced
+#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 13e-20, lower.tail=T, log.p=F)
+[1] 0.000000e+00 3.230769e-60 8.104655e+17 5.331901e+18 9.261329e+18
+[6]          Inf          Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(0, 0, Inf)
-[1] NaN
-Warning message:
-In qcauchy(0, 0, Inf) : NaNs produced
+#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 42, lower.tail=F, log.p=F)
+[1]         Inf 4.296884234 0.054823455 0.016503504 0.008492261 0.000000000
+[7] 0.000000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(0, 0, NaN)
-[1] NaN
+#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 42, lower.tail=T, log.p=F)
+[1] 0.000000e+00 1.000000e-80 2.508584e-03 1.650350e-02 2.866602e-02
+[6]          Inf          Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(0, Inf,  -1)
-[1] NaN
-Warning message:
-In qcauchy(0, Inf, -1) : NaNs produced
+#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 42e123, lower.tail=F, log.p=F)
+[1]           Inf 4.296884e-123 5.482345e-125 1.650350e-125 8.492261e-126
+[6]  0.000000e+00  0.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(0, NaN,  -1)
-[1] NaN
+#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 42e123, lower.tail=T, log.p=F)
+[1]  0.000000e+00 1.000000e-203 2.508584e-126 1.650350e-125 2.866602e-125
+[6]           Inf           Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(Inf, 0, -1)
-[1] NaN
-Warning message:
-In qcauchy(Inf, 0, -1) : NaNs produced
+#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 13e-20, lower.tail=F, log.p=T)
+[1]          Inf 1.388224e+21 1.771219e+19 5.331901e+18 2.743653e+18
+[6] 0.000000e+00 0.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(NaN, 0, -1)
-[1] NaN
+#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 13e-20, lower.tail=T, log.p=T)
+[1] 0.000000e+00 3.230769e-60 8.104655e+17 5.331901e+18 9.261329e+18
+[6]          Inf          Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), -0.01, 0.03, lower.tail=F, log.p=F)
-[1]           Inf  2.273642e+76  8.233051e-02 -1.000000e-02 -3.179628e-02
-[6]          -Inf          -Inf
+#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 42, lower.tail=F, log.p=T)
+[1]         Inf 4.296884234 0.054823455 0.016503504 0.008492261 0.000000000
+[7] 0.000000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), -0.01, 0.03, lower.tail=T, log.p=F)
-[1]          -Inf -2.273642e+76 -1.023305e-01 -1.000000e-02  1.179628e-02
-[6]           Inf           Inf
+#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 42, lower.tail=T, log.p=T)
+[1] 0.000000e+00 1.000000e-80 2.508584e-03 1.650350e-02 2.866602e-02
+[6]          Inf          Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), -5, 5, lower.tail=F, log.p=F)
-[1]           Inf  3.789403e+78  1.038842e+01 -5.000000e+00 -8.632713e+00
-[6]          -Inf          -Inf
+#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 42e123, lower.tail=F, log.p=T)
+[1]           Inf 4.296884e-123 5.482345e-125 1.650350e-125 8.492261e-126
+[6]  0.000000e+00  0.000000e+00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), -5, 5, lower.tail=T, log.p=F)
-[1]          -Inf -3.789403e+78 -2.038842e+01 -5.000000e+00 -1.367287e+00
+#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 42e123, lower.tail=T, log.p=T)
+[1]  0.000000e+00 1.000000e-203 2.508584e-126 1.650350e-125 2.866602e-125
 [6]           Inf           Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, -1, lower.tail=F, log.p=F)
-[1] NaN NaN NaN NaN NaN NaN NaN
+#qf(-0.42e-38, 5, 5, 5)
+[1] NaN
+Warning message:
+In qf(-4.2e-39, 5, 5, 5) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qf(-42, 5, 5, 5)
+[1] NaN
 Warning message:
-In qcauchy(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1), 0, -1,  :
-  NaNs produced
+In qf(-42, 5, 5, 5) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0, -1, lower.tail=T, log.p=F)
-[1] NaN NaN NaN NaN NaN NaN NaN
+#qf(-Inf, 5, 5, 5)
+[1] NaN
 Warning message:
-In qcauchy(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1), 0, -1,  :
-  NaNs produced
+In qf(-Inf, 5, 5, 5) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), -0.01, 0.03, lower.tail=F, log.p=T)
-[1]           Inf  2.273642e+76  8.233051e-02 -1.000000e-02 -3.179628e-02
-[6]          -Inf          -Inf
+#qf(0, -1,  5,  5)
+[1] NaN
+Warning message:
+In qf(0, -1, 5, 5) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), -0.01, 0.03, lower.tail=T, log.p=T)
-[1]          -Inf -2.273642e+76 -1.023305e-01 -1.000000e-02  1.179628e-02
-[6]           Inf           Inf
+#qf(0, -Inf,  5,  5)
+[1] NaN
+Warning message:
+In qf(0, -Inf, 5, 5) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), -5, 5, lower.tail=F, log.p=T)
-[1]           Inf  3.789403e+78  1.038842e+01 -5.000000e+00 -8.632713e+00
-[6]          -Inf          -Inf
+#qf(0, 0,  5,  5)
+[1] NaN
+Warning message:
+In qf(0, 0, 5, 5) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), -5, 5, lower.tail=T, log.p=T)
-[1]          -Inf -3.789403e+78 -2.038842e+01 -5.000000e+00 -1.367287e+00
-[6]           Inf           Inf
+#qf(0, 5,  5, -1)
+[1] NaN
+Warning message:
+In qf(0, 5, 5, -1) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, -1, lower.tail=F, log.p=T)
-[1] NaN NaN NaN NaN NaN NaN NaN
+#qf(0, 5,  5, -Inf)
+[1] NaN
 Warning message:
-In qcauchy(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 0,  :
-  NaNs produced
+In qf(0, 5, 5, -Inf) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qcauchy(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0, -1, lower.tail=T, log.p=T)
-[1] NaN NaN NaN NaN NaN NaN NaN
-Warning message:
-In qcauchy(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 0,  :
-  NaNs produced
+#qf(0, 5,  5, 0)
+[1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(-0.42e-38, 13e-20)
+#qf(0, 5,  5, Inf)
 [1] NaN
 Warning message:
-In qexp(-4.2e-39, 1.3e-19) : NaNs produced
+In qf(0, 5, 5, Inf) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(-42, 13e-20)
+#qf(0, 5,  5, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qf(0, 5, -1,  5)
 [1] NaN
 Warning message:
-In qexp(-42, 1.3e-19) : NaNs produced
+In qf(0, 5, -1, 5) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(-Inf, 13e-20)
+#qf(0, 5, -Inf,  5)
 [1] NaN
 Warning message:
-In qexp(-Inf, 1.3e-19) : NaNs produced
+In qf(0, 5, -Inf, 5) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(0, -1)
+#qf(0, 5, 0,  5)
 [1] NaN
 Warning message:
-In qexp(0, -1) : NaNs produced
+In qf(0, 5, 0, 5) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(0, -Inf)
+#qf(0, 5, Inf,  5)
 [1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(0, 0)
-[1] 0
+#qf(0, 5, NaN,  5)
+[1] NaN
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(0, Inf)
+#qf(0, Inf,  5,  5)
 [1] 0
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(0, NaN)
+#qf(0, NaN,  5,  5)
 [1] NaN
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(Inf, 13e-20)
+#qf(Inf, 5, 5, 5)
 [1] NaN
 Warning message:
-In qexp(Inf, 1.3e-19) : NaNs produced
+In qf(Inf, 5, 5, 5) : NaNs produced
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(NaN, 13e-20)
+#qf(NaN, 5, 5, 5)
 [1] NaN
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 13e-20, lower.tail=F, log.p=F)
-[1]          Inf 1.388224e+21 1.771219e+19 5.331901e+18 2.743653e+18
+#qf(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.12e-10, 6, 31e10, lower.tail=F, log.p=F)
+[1]          Inf          Inf 7.505999e+26 7.505999e+26 7.505999e+26
 [6] 0.000000e+00 0.000000e+00
+There were 50 or more warnings (use warnings() to see the first 50)
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 13e-20, lower.tail=T, log.p=F)
-[1] 0.000000e+00 3.230769e-60 8.104655e+17 5.331901e+18 9.261329e+18
+#qf(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 0.12e-10, 6, 31e10, lower.tail=T, log.p=F)
+[1] 0.000000e+00 5.090863e+20 7.505999e+26 7.505999e+26 7.505999e+26
 [6]          Inf          Inf
+There were 50 or more warnings (use warnings() to see the first 50)
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 42, lower.tail=F, log.p=F)
-[1]         Inf 4.296884234 0.054823455 0.016503504 0.008492261 0.000000000
-[7] 0.000000000
+#qf(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 5, 0.12e-10, 5, lower.tail=F, log.p=F)
+[1]     Inf     Inf 3602.88 3602.88 3602.88    0.00    0.00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 42, lower.tail=T, log.p=F)
-[1] 0.000000e+00 1.000000e-80 2.508584e-03 1.650350e-02 2.866602e-02
+#qf(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 5, 0.12e-10, 5, lower.tail=T, log.p=F)
+[1] 0.000000e+00 1.293365e-38 3.602880e+03 3.602880e+03 3.602880e+03
 [6]          Inf          Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 42e123, lower.tail=F, log.p=F)
-[1]           Inf 4.296884e-123 5.482345e-125 1.650350e-125 8.492261e-126
-[6]  0.000000e+00  0.000000e+00
+#qf(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 5, 5, 5, lower.tail=F, log.p=F)
+[1]      Inf      Inf 6.772533 2.075393 1.308959 0.000000 0.000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 42e123, lower.tail=T, log.p=F)
-[1]  0.000000e+00 1.000000e-203 2.508584e-126 1.650350e-125 2.866602e-125
-[6]           Inf           Inf
+#qf(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 5, 5, 5, lower.tail=T, log.p=F)
+[1] 0.000000e+00 6.160198e-32 6.602106e-01 2.075393e+00 3.312503e+00
+[6]          Inf          Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 13e-20, lower.tail=F, log.p=T)
-[1]          Inf 1.388224e+21 1.771219e+19 5.331901e+18 2.743653e+18
+#qf(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 5, 6, 0.12e-10, lower.tail=F, log.p=F)
+[1]       Inf       Inf 3.1075117 0.9765364 0.6067423 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qf(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 5, 6, 0.12e-10, lower.tail=T, log.p=F)
+[1] 0.000000e+00 2.344125e-32 2.937283e-01 9.765364e-01 1.560462e+00
+[6]          Inf          Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qf(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.12e-10, 6, 31e10, lower.tail=F, log.p=T)
+[1]          Inf          Inf 7.505999e+26 7.505999e+26 7.505999e+26
 [6] 0.000000e+00 0.000000e+00
+There were 50 or more warnings (use warnings() to see the first 50)
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 13e-20, lower.tail=T, log.p=T)
-[1] 0.000000e+00 3.230769e-60 8.104655e+17 5.331901e+18 9.261329e+18
+#qf(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 0.12e-10, 6, 31e10, lower.tail=T, log.p=T)
+[1] 0.000000e+00 5.090863e+20 7.505999e+26 7.505999e+26 7.505999e+26
 [6]          Inf          Inf
+There were 50 or more warnings (use warnings() to see the first 50)
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 42, lower.tail=F, log.p=T)
-[1]         Inf 4.296884234 0.054823455 0.016503504 0.008492261 0.000000000
-[7] 0.000000000
+#qf(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 5, 0.12e-10, 5, lower.tail=F, log.p=T)
+[1]     Inf     Inf 3602.88 3602.88 3602.88    0.00    0.00
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 42, lower.tail=T, log.p=T)
-[1] 0.000000e+00 1.000000e-80 2.508584e-03 1.650350e-02 2.866602e-02
+#qf(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 5, 0.12e-10, 5, lower.tail=T, log.p=T)
+[1] 0.000000e+00 1.293365e-38 3.602880e+03 3.602880e+03 3.602880e+03
 [6]          Inf          Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 42e123, lower.tail=F, log.p=T)
-[1]           Inf 4.296884e-123 5.482345e-125 1.650350e-125 8.492261e-126
-[6]  0.000000e+00  0.000000e+00
+#qf(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 5, 5, 5, lower.tail=F, log.p=T)
+[1]      Inf      Inf 6.772533 2.075393 1.308959 0.000000 0.000000
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
-#qexp(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 42e123, lower.tail=T, log.p=T)
-[1]  0.000000e+00 1.000000e-203 2.508584e-126 1.650350e-125 2.866602e-125
-[6]           Inf           Inf
+#qf(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 5, 5, 5, lower.tail=T, log.p=T)
+[1] 0.000000e+00 6.160198e-32 6.602106e-01 2.075393e+00 3.312503e+00
+[6]          Inf          Inf
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qf(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 5, 6, 0.12e-10, lower.tail=F, log.p=T)
+[1]       Inf       Inf 3.1075117 0.9765364 0.6067423 0.0000000 0.0000000
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qf(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 5, 6, 0.12e-10, lower.tail=T, log.p=T)
+[1] 0.000000e+00 2.344125e-32 2.937283e-01 9.765364e-01 1.560462e+00
+[6]          Inf          Inf
 
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
 #qgamma(-0.42e-38, 1, scale=2)
@@ -113026,6 +114634,250 @@ In qgamma(Inf, 1, scale = 2) : NaNs produced
 #qgamma(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 11e11, scale=23e-11, lower.tail=T, log.p=T)
 [1]   0.0000 252.9955 252.9997 253.0000 253.0001      Inf      Inf
 
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(-0.42e-38, 7, 11, 4)
+[1] NaN
+Warning message:
+In qhyper(-4.2e-39, 7, 11, 4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(-42, 7, 11, 4)
+[1] NaN
+Warning message:
+In qhyper(-42, 7, 11, 4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(-Inf, 7, 11, 4)
+[1] NaN
+Warning message:
+In qhyper(-Inf, 7, 11, 4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, -10,  11,  4)
+[1] NaN
+Warning message:
+In qhyper(0, -10, 11, 4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, -Inf,  11,  4)
+[1] NaN
+Warning message:
+In qhyper(0, -Inf, 11, 4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, 0.3,  11,  4)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, 7,  11, -10)
+[1] NaN
+Warning message:
+In qhyper(0, 7, 11, -10) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, 7,  11, -Inf)
+[1] NaN
+Warning message:
+In qhyper(0, 7, 11, -Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, 7,  11, 0.3)
+[1] 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, 7,  11, Inf)
+[1] NaN
+Warning message:
+In qhyper(0, 7, 11, Inf) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, 7,  11, NaN)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, 7, -10,  4)
+[1] NaN
+Warning message:
+In qhyper(0, 7, -10, 4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, 7, -Inf,  4)
+[1] NaN
+Warning message:
+In qhyper(0, 7, -Inf, 4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, 7, 0.3,  4)
+[1] 4
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, 7, Inf,  4)
+[1] NaN
+Warning message:
+In qhyper(0, 7, Inf, 4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, 7, NaN,  4)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, Inf,  11,  4)
+[1] NaN
+Warning message:
+In qhyper(0, Inf, 11, 4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(0, NaN,  11,  4)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(Inf, 7, 11, 4)
+[1] NaN
+Warning message:
+In qhyper(Inf, 7, 11, 4) : NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(NaN, 7, 11, 4)
+[1] NaN
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 11, 7e12, 7, lower.tail=F, log.p=F)
+[1] 7 1 0 0 0 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 11, 7e12, 7, lower.tail=T, log.p=F)
+[1] 0 0 0 0 0 7 7
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 3, 4, 10, lower.tail=F, log.p=F)
+[1] NaN NaN NaN NaN NaN NaN NaN
+Warning message:
+In qhyper(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1), 3, 4, 10,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 3, 4, 10, lower.tail=T, log.p=F)
+[1] NaN NaN NaN NaN NaN NaN NaN
+Warning message:
+In qhyper(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1), 3, 4, 10,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 5, 5, 5, lower.tail=F, log.p=F)
+[1] 5 5 4 2 2 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 5, 5, 5, lower.tail=T, log.p=F)
+[1] 0 0 1 2 3 5 5
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7, 11, 12, lower.tail=F, log.p=F)
+[1] 7 7 6 5 4 1 1
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7, 11, 12, lower.tail=T, log.p=F)
+[1] 1 1 3 5 5 7 7
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7, 11, 4, lower.tail=F, log.p=F)
+[1] 4 4 3 2 1 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7, 11, 4, lower.tail=T, log.p=F)
+[1] 0 0 0 2 2 4 4
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7e12, 11, 4, lower.tail=F, log.p=F)
+[1] 4 4 4 4 4 0 0
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1), 7e12, 11, 4, lower.tail=T, log.p=F)
+[1] 0 0 4 4 4 4 4
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 11, 7e12, 7, lower.tail=F, log.p=T)
+[1] NaN   1   0   0   0   0   0
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 11,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 11, 7e12, 7, lower.tail=T, log.p=T)
+[1] NaN   0   0   0   0   7   7
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 11,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 3, 4, 10, lower.tail=F, log.p=T)
+[1] NaN NaN NaN NaN NaN NaN NaN
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 3,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 3, 4, 10, lower.tail=T, log.p=T)
+[1] NaN NaN NaN NaN NaN NaN NaN
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 3,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 5, 5, 5, lower.tail=F, log.p=T)
+[1] NaN   5   4   2   2   0   0
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 5,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 5, 5, 5, lower.tail=T, log.p=T)
+[1] NaN   0   1   2   3   5   5
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 5,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7, 11, 12, lower.tail=F, log.p=T)
+[1] NaN   7   6   5   4   1   1
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 7,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7, 11, 12, lower.tail=T, log.p=T)
+[1] NaN   1   3   5   5   7   7
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 7,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7, 11, 4, lower.tail=F, log.p=T)
+[1] NaN   4   3   2   1   0   0
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 7,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7, 11, 4, lower.tail=T, log.p=T)
+[1] NaN   0   0   2   2   4   4
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 7,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7e12, 11, 4, lower.tail=F, log.p=T)
+[1] NaN   4   4   4   4   0   0
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 7e+12,  :
+  NaNs produced
+
+##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
+#qhyper(log(c(0, 42e-80, 0.1, 0.5, 0.7, 1-42e-80, 1)), 7e12, 11, 4, lower.tail=T, log.p=T)
+[1] NaN   0   4   4   4   4   4
+Warning message:
+In qhyper(log(c(0, 4.2e-79, 0.1, 0.5, 0.7, 1 - 4.2e-79, 1)), 7e+12,  :
+  NaNs produced
+
 ##com.oracle.truffle.r.test.library.stats.TestDistributions.testQuantileFunctions#Output.MayIgnoreWarningContext#
 #qnorm(-0.42e-38, 0, -1)
 [1] NaN
diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/stats/TestDistributions.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/stats/TestDistributions.java
index 6d85cfe17de6c6bcc8c847cccf6b8d0ff4b572bf..54841d07cd4906fc83f11d5136cf5efe764a9c62 100644
--- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/stats/TestDistributions.java
+++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/library/stats/TestDistributions.java
@@ -82,7 +82,40 @@ public class TestDistributions extends TestBase {
                     addErrorParamValues("-1", "0").
                     test("13e-20", withDefaultQ("10", "-10")).
                     test("42", withDefaultQ("42")).
-                    test("42e123", withDefaultQ("33e123"))
+                    test("42e123", withDefaultQ("33e123")),
+            // tests for nchisq, which is called in chisq when second param is not missing
+            distr("chisq").
+                    addErrorParamValues("-3", "0").
+                    test("1, 1", withDefaultQ("0.5", "2")).
+                    test("420, 4", withQuantiles("0.42e-10", "100", "13e10", "11e111")).
+                    test("0.13e-8, 1", withQuantiles("0.42e-10", "100", "13e10", "11e111")).
+                    test("1, 0.13e-8", withQuantiles("0.42e-10", "100", "13e10", "11e111")),
+            // tests of nbeta, which is called in beta when third param is not missing
+            distr("beta").
+                    addErrorParamValues("-4", "0").
+                    test("10, 15, 0", withDefaultQ("10", "15", "100")).
+                    test("7, 13, 3", withDefaultQ("10", "15", "100")).
+                    test("7, 11, 0.37e-10", withQuantiles("10", "15", "100")).
+                    test("7, 113e11, 1", withQuantiles("10", "15", "100")),
+            // tests of nf (non central F distribution)
+            distr("f").
+                    addErrorParamValues("-1", "0").
+                    test("5, 5, 5", withDefaultQ("1", "10", "44", "123")).
+                    test("5, 0.12e-10, 5", withDefaultQ("1", "10", "44", "123")).
+                    test("5, 6, 0.12e-10", withDefaultQ("1", "10", "44", "123")).
+                    test("0.12e-10, 6, 31e10", withDefaultQ("1", "10", "44", "123")),
+            // hyper-geometric: #white balls in urn, #black balls in urn, #drawn balls
+            distr("hyper").
+                    addErrorParamValues("-10", "0.3").
+                    test("7, 11, 4", withQuantiles("1", "2", "3", "4", "20", "12e12")).
+                    test("7e12, 11, 4", withQuantiles("1", "2", "3", "4", "20", "12e12")).
+                    test("11, 7e12, 7", withQuantiles("1", "2", "3", "7", "20", "12e12")).
+                    // more drawn balls then there is white
+                    test("7, 11, 12", withQuantiles("1", "2", "3", "4", "5", "6", "7", "8", "11", "20", "12e12")).
+                    // this should show non-integer warnings for quantiles
+                    test("5, 5, 5", withQuantiles("0.1", "-Inf", "Inf", "0.3e89")).
+                    // too many drawn balls: should be error
+                    test("3, 4, 10", withQuantiles("2"))
     };
     // @formatter:on
 
diff --git a/mx.fastr/copyrights/gnu_r.core.copyright.star.regex b/mx.fastr/copyrights/gnu_r.core.copyright.star.regex
index b89f17651f1f7a735e95943483166542481ca401..f2659e583f63f8a67d0e648f9c07248211e150c1 100644
--- a/mx.fastr/copyrights/gnu_r.core.copyright.star.regex
+++ b/mx.fastr/copyrights/gnu_r.core.copyright.star.regex
@@ -1 +1 @@
-/\*\n \* This material is distributed under the GNU General Public License\n \* Version 2. You may review the terms of this license at\n \* http://www.gnu.org/licenses/gpl-2.0.html\n \*\n \* Copyright \(c\) (?:[1-2][09][0-9][0-9]--?)?[1-2][09][0-9][0-9], The R Core Team\n \* Copyright \(c\) (?:(20[0-9][0-9]), )?(20[0-9][0-9]), Oracle and/or its affiliates\n \*\n \* All rights reserved.\n \*/\n.*
+/\*\n \* This material is distributed under the GNU General Public License\n \* Version 2. You may review the terms of this license at\n \* http://www.gnu.org/licenses/gpl-2.0.html\n \*\n \* Copyright \(c\) (?:[1-2][09][0-9][0-9]--?)?(:?[1-2][09])?[0-9]?[0-9], The R Core Team\n \* Copyright \(c\) (?:(20[0-9][0-9]), )?(20[0-9][0-9]), Oracle and/or its affiliates\n \*\n \* All rights reserved.\n \*/\n.*
diff --git a/mx.fastr/copyrights/gnu_r_ihaka.copyright.star.regex b/mx.fastr/copyrights/gnu_r_ihaka.copyright.star.regex
index 6d4963665815e19001d415014c005f60e8bfa49b..53c1d8c22ec45e849999d5d42177053b6a70a3f3 100644
--- a/mx.fastr/copyrights/gnu_r_ihaka.copyright.star.regex
+++ b/mx.fastr/copyrights/gnu_r_ihaka.copyright.star.regex
@@ -1 +1 @@
-/\*\n \* This material is distributed under the GNU General Public License\n \* Version 2. You may review the terms of this license at\n \* http://www.gnu.org/licenses/gpl-2.0.html\n \*\n \* Copyright \(C\) 1998 Ross Ihaka\n \* Copyright \(c\) (?:[1-2][09][0-9][0-9]--?)?[1-2][09][0-9][0-9], The R Core Team\n \* Copyright \(c\) (?:[1-2][09][0-9][0-9]--?)?[1-2][09][0-9][0-9], The R Foundation\n \* Copyright \(c\) (?:(20[0-9][0-9]), )?(20[0-9][0-9]), Oracle and/or its affiliates\n \*\n \* All rights reserved.\n \*/\n.*
+/\*\n \* This material is distributed under the GNU General Public License\n \* Version 2. You may review the terms of this license at\n \* http://www.gnu.org/licenses/gpl-2.0.html\n \*\n \* Copyright \(C\) 1998 Ross Ihaka\n \* Copyright \(c\) (?:[1-2][09][0-9][0-9]--?)?(?:[1-2][09])?[0-9][0-9], The R Core Team\n \* Copyright \(c\) (?:[1-2][09][0-9][0-9]--?)?(?:[1-2][09])?[0-9][0-9], The R Foundation\n \* Copyright \(c\) (?:(20[0-9][0-9]), )?(20[0-9][0-9]), Oracle and/or its affiliates\n \*\n \* All rights reserved.\n \*/\n.*
diff --git a/mx.fastr/copyrights/gnu_r_ihaka_core.copyright.star.regex b/mx.fastr/copyrights/gnu_r_ihaka_core.copyright.star.regex
index 1bc53ecfd3018063d32ee5abccbcc45d2f7d5a89..8ede89dd35f94ed03a8536f0e424da12c89a727e 100644
--- a/mx.fastr/copyrights/gnu_r_ihaka_core.copyright.star.regex
+++ b/mx.fastr/copyrights/gnu_r_ihaka_core.copyright.star.regex
@@ -1 +1 @@
-/\*\n \* This material is distributed under the GNU General Public License\n \* Version 2. You may review the terms of this license at\n \* http://www.gnu.org/licenses/gpl-2.0.html\n \*\n \* Copyright \(C\) 1998 Ross Ihaka\n \* Copyright \(c\) (?:[1-2][09][0-9][0-9]--?)?[1-2][09][0-9][0-9], The R Core Team\n \* Copyright \(c\) (?:(20[0-9][0-9]), )?(20[0-9][0-9]), Oracle and/or its affiliates\n \*\n \* All rights reserved.\n \*/\n.*
+/\*\n \* This material is distributed under the GNU General Public License\n \* Version 2. You may review the terms of this license at\n \* http://www.gnu.org/licenses/gpl-2.0.html\n \*\n \* Copyright \(C\) 1998 Ross Ihaka\n \* Copyright \(c\) (?:[1-2][09][0-9][0-9]--?)?(?:[1-2][09])?[0-9][0-9], The R Core Team\n \* Copyright \(c\) (?:(20[0-9][0-9]), )?(20[0-9][0-9]), Oracle and/or its affiliates\n \*\n \* All rights reserved.\n \*/\n.*
diff --git a/mx.fastr/copyrights/overrides b/mx.fastr/copyrights/overrides
index 0067deaae73e5fef4764505f61ed6df5d8296b60..1e88b6c8693d9058247af6629a2e3e753ef8afb8 100644
--- a/mx.fastr/copyrights/overrides
+++ b/mx.fastr/copyrights/overrides
@@ -44,11 +44,18 @@ com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DPQ.java,gnu
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Rt.java,gnu_r_ihaka_core.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/GammaFunctions.java,gnu_r_qgamma.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QHyper.java,gnu_r_ihaka_core.copyright
+com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DHyper.java,gnu_r.core.copyright
+com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PHyper.java,gnu_r_ihaka.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Qt.java,gnu_r_ihaka.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Pt.java,gnu_r_scan.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RHyper.java,gnu_r_ihaka.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/MathInit.java,gnu_r.core.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Pbeta.java,gnu_r.core.copyright
+com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PNBeta.java,gnu_r.core.copyright
+com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QNBeta.java,gnu_r.core.copyright
+com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Qnf.java,gnu_r.core.copyright
+com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Dnf.java,gnu_r.core.copyright
+com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DNBeta.java,gnu_r_ihaka_core.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/LBeta.java,gnu_r_ihaka.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Pbinom.java,gnu_r_ihaka.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Pf.java,gnu_r_ihaka_core.copyright
@@ -65,6 +72,9 @@ com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Rbinom.java,
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Unif.java,gnu_r_ihaka_core.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Rnorm.java,gnu_r.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Chisq.java,gnu_r_ihaka_core.copyright
+com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PNChisq.java,gnu_r.copyright
+com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/QNChisq.java,gnu_r_gentleman_ihaka.copyright
+com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/DNChisq.java,gnu_r_ihaka.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/SplineFunctions.java,gnu_r_splines.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/StatsFunctions.java,gnu_r_gentleman_ihaka.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RandGenerationFunctions.java,gnu_r_gentleman_ihaka.copyright
@@ -79,6 +89,7 @@ com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RGamma.java,
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/PGamma.java,gnu_r_welinder.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RNbinomMu.java,gnu_r_ihaka_core.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Logis.java,gnu_r_ihaka_core.copyright
+com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Pnf.java,gnu_r_ihaka_core.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Rf.java,gnu_r_ihaka_core.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Exp.java,gnu_r_ihaka_core.copyright
 com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/Geom.java,gnu_r_ihaka_core.copyright