You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2022/01/23 08:30:09 UTC

[commons-statistics] 02/02: Beta distribution to use beta functions from Commons Numbers

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git

commit 955b6640ce8076d1fc474295c0607ddb38525155
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Jan 23 08:28:31 2022 +0000

    Beta distribution to use beta functions from Commons Numbers
    
    Use RegularizedBeta.derivative.
    
    Use LogBeta in place of 3 LogGamma calls.
    
    Test data has been updated to 17 significant figures. Test tolerance
    lowered from 5e-14 to 1e-14.
---
 .../statistics/distribution/BetaDistribution.java     | 19 +++++++++++--------
 .../statistics/distribution/test.beta.1.properties    | 10 +++++-----
 .../statistics/distribution/test.beta.10.properties   | 12 ++++++------
 .../statistics/distribution/test.beta.11.properties   | 12 ++++++------
 .../statistics/distribution/test.beta.12.properties   |  4 ++--
 .../statistics/distribution/test.beta.13.properties   |  6 +++---
 .../statistics/distribution/test.beta.14.properties   |  4 ++--
 .../statistics/distribution/test.beta.15.properties   |  6 +++---
 .../statistics/distribution/test.beta.16.properties   |  4 ++--
 .../statistics/distribution/test.beta.17.properties   |  4 ++--
 .../statistics/distribution/test.beta.18.properties   |  4 ++--
 .../statistics/distribution/test.beta.19.properties   |  6 +++---
 .../statistics/distribution/test.beta.2.properties    | 12 ++++++------
 .../statistics/distribution/test.beta.20.properties   |  4 ++--
 .../statistics/distribution/test.beta.21.properties   |  4 ++--
 .../statistics/distribution/test.beta.22.properties   |  4 ++--
 .../statistics/distribution/test.beta.23.properties   |  6 +++---
 .../statistics/distribution/test.beta.24.properties   |  4 ++--
 .../statistics/distribution/test.beta.25.properties   |  4 ++--
 .../statistics/distribution/test.beta.3.properties    | 12 ++++++------
 .../statistics/distribution/test.beta.4.properties    | 12 ++++++------
 .../statistics/distribution/test.beta.5.properties    | 12 ++++++------
 .../statistics/distribution/test.beta.6.properties    | 12 ++++++------
 .../statistics/distribution/test.beta.7.properties    |  8 ++++----
 .../statistics/distribution/test.beta.8.properties    | 12 ++++++------
 .../statistics/distribution/test.beta.9.properties    | 12 ++++++------
 26 files changed, 106 insertions(+), 103 deletions(-)

diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/BetaDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/BetaDistribution.java
index 7587966..e2b1012 100644
--- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/BetaDistribution.java
+++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/BetaDistribution.java
@@ -17,7 +17,7 @@
 package org.apache.commons.statistics.distribution;
 
 import org.apache.commons.numbers.gamma.RegularizedBeta;
-import org.apache.commons.numbers.gamma.LogGamma;
+import org.apache.commons.numbers.gamma.LogBeta;
 import org.apache.commons.rng.UniformRandomProvider;
 import org.apache.commons.rng.sampling.distribution.ChengBetaSampler;
 
@@ -46,8 +46,8 @@ public final class BetaDistribution extends AbstractContinuousDistribution {
     private final double alpha;
     /** Second shape parameter. */
     private final double beta;
-    /** Normalizing factor used in density computations.*/
-    private final double z;
+    /** Normalizing factor used in log density computations. log(beta(a, b)). */
+    private final double logBeta;
     /** Cached value for inverse probability function. */
     private final double mean;
     /** Cached value for inverse probability function. */
@@ -61,7 +61,7 @@ public final class BetaDistribution extends AbstractContinuousDistribution {
                              double beta) {
         this.alpha = alpha;
         this.beta = beta;
-        z = LogGamma.value(alpha) + LogGamma.value(beta) - LogGamma.value(alpha + beta);
+        logBeta = LogBeta.value(alpha, beta);
         final double alphabetasum = alpha + beta;
         mean = alpha / alphabetasum;
         variance = (alpha * beta) / ((alphabetasum * alphabetasum) * (alphabetasum + 1));
@@ -111,7 +111,10 @@ public final class BetaDistribution extends AbstractContinuousDistribution {
      */
     @Override
     public double density(double x) {
-        return Math.exp(logDensity(x));
+        if (x < 0 || x > 1) {
+            return 0;
+        }
+        return RegularizedBeta.derivative(x, alpha, beta);
     }
 
     /** {@inheritDoc}
@@ -133,7 +136,7 @@ public final class BetaDistribution extends AbstractContinuousDistribution {
             }
             // Special case of cancellation: x^(a-1) (1-x)^(b-1) / B(a, b)
             if (alpha == 1) {
-                return -z;
+                return -logBeta;
             }
             return Double.NEGATIVE_INFINITY;
         } else if (x == 1) {
@@ -145,13 +148,13 @@ public final class BetaDistribution extends AbstractContinuousDistribution {
             }
             // Special case of cancellation: x^(a-1) (1-x)^(b-1) / B(a, b)
             if (beta == 1) {
-                return -z;
+                return -logBeta;
             }
             return Double.NEGATIVE_INFINITY;
         } else {
             final double logX = Math.log(x);
             final double log1mX = Math.log1p(-x);
-            return (alpha - 1) * logX + (beta - 1) * log1mX - z;
+            return (alpha - 1) * logX + (beta - 1) * log1mX - logBeta;
         }
     }
 
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.1.properties
index f034f92..f3be562 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.1.properties
@@ -16,10 +16,10 @@
 parameters = 0.1 0.1
 # Computed using Matlab
 mean = 0.5
-variance = 0.208333333333333
+variance = 0.20833333333333334
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0  0 0.406385093936276 0.439709190223346 0.462804186115552 0.482120045609328 0.500000000000000 0.517879954390672 0.537195813884448 0.560290809776654 0.593614906063724 1 1
-pdf.values = 0  Infinity 0.442988958666524 0.263938762316795 0.206639715373253 0.183240320487425 0.176630277977874 0.183240320487425 0.206639715373253 0.263938762316795 0.442988958666524 Infinity 0
-sf.values = 1 1 0.593614906063724 0.560290809776654 0.537195813884448 0.517879954390672 0.500000000000000 0.482120045609328 0.462804186115552 0.439709190223346 0.406385093936276 0 0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.40638509393627625 0.43970919022334581 0.46280418611555235 0.48212004560932825 0.5 0.5178799543906718 0.5371958138844477 0.56029080977665435 0.59361490606372369 1 1
+pdf.values = 0 Inf 0.44298895866652355 0.26393876231679497 0.20663971537325304 0.18324032048742506 0.17663027797787384 0.18324032048742506 0.20663971537325304 0.26393876231679503 0.44298895866652377 Inf 0
+sf.values = 1 1 0.59361490606372369 0.56029080977665413 0.5371958138844477 0.5178799543906718 0.49999999999999994 0.48212004560932825 0.46280418611555235 0.4397091902233457 0.40638509393627625 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.10.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.10.properties
index fbe8b60..f2ffbf8 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.10.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.10.properties
@@ -15,11 +15,11 @@
 
 parameters = 0.5 4.0
 # Computed using Matlab
-mean = 0.111111111111111
-variance = 0.017957351290685
+mean = 0.1111111111111111
+variance = 0.017957351290684626
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0  0 0.626625082597741 0.804984471899925 0.898778484206134 0.950264436880598 0.977796095859523 0.991483736629099 0.997455625383593 0.999522385942406 0.999971488851370 1 1
-pdf.values = 0  Inf 2.52142232809988  1.25219806739988  0.684938469046825 0.373544048607390 0.193349510480697 0.0903696114115064  0.0352965948694063  0.00978279740156159 0.00115291373026972 0 0
-sf.values = 1 1 0.373374917402260 0.195015528100075 0.101221515793866 0.0497355631194020  0.0222039041404773  0.00851626337090129 0.00254437461640681 0.000477614057594006  2.85111486302981e-05  0 0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.62662508259774052 0.80498447189992484 0.89877848420613371 0.95026443688059803 0.97779609585952276 0.99148373662909872 0.99745562538359323 0.99952238594240594 0.99997148885136966 1 1
+pdf.values = 0 Inf 2.5214223280998818 1.2521980673998827 0.68493846904682498 0.37354404860738988 0.19334951048069668 0.090369611411506442 0.035296594869406332 0.0097827974015615871 0.0011529137302697221 0 0
+sf.values = 1 1 0.37337491740225948 0.19501552810007516 0.10122151579386635 0.049735563119401985 0.022203904140477276 0.0085162633709012919 0.0025443746164068113 0.00047761405759400575 2.8511148630298118e-05 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.11.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.11.properties
index 2231ec7..6af1d17 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.11.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.11.properties
@@ -15,11 +15,11 @@
 
 parameters = 1.0 0.1
 # Computed using Matlab
-mean = 0.909090909090909
-variance = 0.039354584809130
+mean = 0.90909090909090906
+variance = 0.039354584809130261
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0  0 0.0104807417937856  0.0220672314570715  0.0350389048801824  0.0497997834943236  0.0669670084631926  0.0875564634445192  0.113431849434787 0.148660077479215 0.205671765275719 1 1
-pdf.values = 0  0.100000000000000 0.109946584245135 0.122241596067866 0.137851585017117 0.158366702750946 0.186606598307362 0.228110884138870 0.295522716855071 0.425669961260392 0.794328234724282 Inf 0
-sf.values = 1 1 0.989519258206214 0.977932768542929 0.964961095119818 0.950200216505676 0.933032991536807 0.912443536555481 0.886568150565213 0.851339922520785 0.794328234724282 0 0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.010480741793785622 0.022067231457071509 0.035038904880182388 0.049799783494323582 0.066967008463192548 0.087556463444519186 0.11343184943478668 0.14866007747921539 0.20567176527571851 1 1
+pdf.values = 0 0.10000000000000001 0.10994658424513494 0.1222415960678661 0.13785158501711683 0.15836670275094611 0.18660659830736154 0.22811088413887023 0.2955227168550712 0.42566996126039247 0.79432823472428193 Inf 0
+sf.values = 1 1 0.98951925820621434 0.97793276854292854 0.96496109511981765 0.95020021650567643 0.93303299153680741 0.91244353655548083 0.88656815056521332 0.85133992252078461 0.79432823472428149 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.12.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.12.properties
index 7abc208..8b5a9a4 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.12.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.12.properties
@@ -19,7 +19,7 @@ mean = 0.66666666666666663
 variance = 0.088888888888888892
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 0.051316701949486218 0.10557280900008409 0.16333997346592444 0.22540333075851654 0.2928932188134527 0.36754446796632401 0.45227744249483381 0.55278640450004213 0.68377223398316211 1 1
 pdf.values = 0 0.5 0.52704627669472992 0.55901699437494745 0.59761430466719689 0.64549722436790291 0.70710678118654768 0.79056941504209488 0.9128709291752769 1.1180339887498951 1.58113883008419 Inf 0
-sf.values = 1 1 0.948683298050514 0.894427190999916 0.836660026534076 0.774596669241483 0.707106781186547 0.632455532033676 0.547722557505166 0.447213595499958 0.316227766016838 0 0
+sf.values = 1 1 0.94868329805051377 0.89442719099991597 0.83666002653407556 0.7745966692414834 0.70710678118654724 0.63245553203367599 0.54772255750516619 0.44721359549995793 0.31622776601683789 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.13.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.13.properties
index d867bca..643df3b 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.13.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.13.properties
@@ -19,7 +19,7 @@ mean = 0.5
 variance = 0.083333333333333329
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0.0, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.10000000000000003 0.20000000000000004 0.29999999999999993 0.40000000000000008 0.5 0.59999999999999987 0.69999999999999996 0.80000000000000004 0.90000000000000002 1 1
 pdf.values = 0 1 1 1 1 1 1 1 1 1 1 1 0
-sf.values = 1 1 0.900000000000000 0.800000000000000 0.700000000000000 0.600000000000000 0.500000000000000 0.400000000000000 0.300000000000000 0.200000000000000 0.100000000000000 0 0
+sf.values = 1 1 0.89999999999999991 0.79999999999999993 0.70000000000000007 0.59999999999999987 0.5 0.40000000000000008 0.30000000000000004 0.19999999999999996 0.099999999999999964 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.14.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.14.properties
index e238b8b..9f86afd 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.14.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.14.properties
@@ -19,7 +19,7 @@ mean = 0.33333333333333331
 variance = 0.055555555555555552
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 0.19000000000000006 0.35999999999999999 0.51000000000000023 0.64000000000000001 0.75 0.83999999999999997 0.90999999999999992 0.95999999999999996 0.98999999999999999 1 1
 pdf.values = 0 2 1.8 1.6000000000000001 1.3999999999999999 1.2 1 0.80000000000000004 0.60000000000000009 0.39999999999999991 0.19999999999999996 0 0
-sf.values = 1 1 0.810000000000000 0.640000000000000 0.490000000000000 0.360000000000000 0.250000000000000 0.160000000000000 0.0900000000000000  0.0400000000000000  0.0100000000000000  0 0
+sf.values = 1 1 0.80999999999999994 0.64000000000000001 0.48999999999999977 0.35999999999999999 0.25000000000000006 0.16000000000000003 0.090000000000000024 0.039999999999999994 0.01 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.15.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.15.properties
index 5dc0e16..ec23362 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.15.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.15.properties
@@ -16,10 +16,10 @@
 parameters = 1.0 4.0
 # Computed using Matlab
 mean = 0.20000000000000001
-variance = 0.026666666666666672
+variance = 0.026666666666666668
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 0.34389999999999987 0.59040000000000026 0.75990000000000002 0.87040000000000006 0.9375 0.97440000000000004 0.9919 0.99839999999999995 0.99990000000000001 1 1
 pdf.values = 0 4 2.9160000000000008 2.0480000000000005 1.3719999999999999 0.8640000000000001 0.50000000000000022 0.25600000000000012 0.10800000000000005 0.031999999999999994 0.0039999999999999983 0 0
-sf.values = 1 1 0.656100000000000 0.409600000000000 0.240100000000000 0.129600000000000 0.0625000000000000  0.0256000000000000  0.00810000000000000 0.00160000000000000 9.99999999999999e-05  0 0
+sf.values = 1 1 0.65610000000000013 0.40959999999999974 0.24009999999999992 0.12959999999999997 0.062500000000000028 0.025600000000000001 0.008100000000000003 0.0016000000000000007 9.9999999999999869e-05 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.16.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.16.properties
index 1eaf518..ffa028e 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.16.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.16.properties
@@ -19,7 +19,7 @@ mean = 0.95238095238095233
 variance = 0.01462950771706532
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 0.00058554921172346416 0.0025085760862129224 0.0060900720265878658 0.011791774834096561 0.020315358886352223 0.032809851251190306 0.051372078895221711 0.080552883677552423 0.13418222415053294 1 1
 pdf.values = 0 0 0.012094124266964851 0.026893151134930546 0.045491023055648561 0.069681349210416327 0.10263362906904888 0.15055318353165442 0.22755249197840488 0.37458956590914555 0.78638495237703931 Inf 0
-sf.values = 1 1 0.999414450788277 0.997491423913787 0.993909927973412 0.988208225165904 0.979684641113648 0.967190148748810 0.948627921104778 0.919447116322448 0.865817775849467 0 0
+sf.values = 1 1 0.99941445078827651 0.99749142391378709 0.99390992797341216 0.98820822516590345 0.97968464111364773 0.96719014874880971 0.94862792110477834 0.91944711632244758 0.86581777584946706 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.17.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.17.properties
index bca61be..66fec5e 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.17.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.17.properties
@@ -19,7 +19,7 @@ mean = 0.80000000000000004
 variance = 0.045714285714285714
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 0.0038825370469605129 0.016130089900092535 0.0378409694858131 0.070483996910219962 0.1161165235168156 0.17780780835622126 0.26057454736802566 0.37390096630005898 0.54146973927558506 1 1
 pdf.values = 0 0 0.079056941504209499 0.16770509831248426 0.26892643710023856 0.38729833462074181 0.53033008588991071 0.71151247353788538 0.95851447563404069 1.3416407864998741 2.1345374206136567 Inf 0
-sf.values = 1 1 0.996117462953040 0.983869910099907 0.962159030514187 0.929516003089780 0.883883476483184 0.822192191643779 0.739425452631974 0.626099033699941 0.458530260724415 0 0
+sf.values = 1 1 0.99611746295303949 0.98386991009990743 0.96215903051418694 0.92951600308978 0.88388347648318444 0.82219219164377877 0.73942545263197434 0.62609903369994102 0.45853026072441494 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.18.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.18.properties
index 2a56be7..e56f538 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.18.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.18.properties
@@ -19,7 +19,7 @@ mean = 0.66666666666666663
 variance = 0.055555555555555552
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 0.010000000000000009 0.040000000000000029 0.089999999999999983 0.16000000000000003 0.25000000000000006 0.35999999999999999 0.48999999999999977 0.64000000000000012 0.81000000000000005 1 1
 pdf.values = 0 0 0.20000000000000007 0.40000000000000002 0.59999999999999987 0.80000000000000004 1 1.2 1.3999999999999999 1.6000000000000001 1.8 2 0
-sf.values = 1 1 0.990000000000000 0.960000000000000 0.910000000000000 0.840000000000000 0.750000000000000 0.640000000000000 0.510000000000000 0.360000000000000 0.190000000000000 0 0
+sf.values = 1 1 0.98999999999999999 0.95999999999999996 0.91000000000000003 0.83999999999999997 0.75 0.64000000000000001 0.51000000000000023 0.35999999999999988 0.18999999999999995 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.19.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.19.properties
index e4c3a7b..c1a871b 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.19.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.19.properties
@@ -16,10 +16,10 @@
 parameters = 2.0 2.0
 # Computed using Matlab
 mean = 0.5
-variance = 0.049999999999999996
+variance = 0.050000000000000003
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 0.028000000000000008 0.10400000000000008 0.2159999999999998 0.35200000000000004 0.5 0.64799999999999991 0.78400000000000003 0.89600000000000002 0.97199999999999998 1 1
 pdf.values = 0 0 0.54000000000000004 0.96000000000000008 1.2599999999999998 1.4400000000000002 1.5 1.4400000000000002 1.26 0.95999999999999985 0.53999999999999981 0 0
-sf.values = 1 1 0.972000000000000 0.896000000000000 0.784000000000000 0.648000000000000 0.500000000000000 0.352000000000000 0.216000000000000 0.104000000000000 0.0280000000000000  0 0
+sf.values = 1 1 0.97199999999999998 0.89599999999999991 0.78400000000000025 0.64799999999999991 0.5 0.35200000000000004 0.21599999999999997 0.10399999999999997 0.027999999999999983 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.2.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.2.properties
index 66edffa..ad58eb6 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.2.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.2.properties
@@ -15,11 +15,11 @@
 
 parameters = 0.1 0.5
 # Computed using Matlab
-mean = 0.166666666666667
-variance = 0.086805555555556
+mean = 0.16666666666666669
+variance = 0.086805555555555566
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0  0 0.704833622051221 0.759304219445319 0.795176530367368 0.823494838536657 0.848001712399770 0.870603436980005 0.892658587836406 0.915640640375004 0.942366288315790 1 1
-pdf.values = 0  Infinity 0.739458664410644 0.420303655461325 0.311944266317603 0.260079151351645 0.233065049073820 0.221140881157234 0.222272786172717 0.241401058813832 0.307055512274369 Infinity 0
-sf.values = 1 1 0.295166377948779 0.240695780554681 0.204823469632632 0.176505161463343 0.151998287600230 0.129396563019995 0.107341412163595 0.0843593596249964  0.0576337116842096  0 0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.70483362205122113 0.75930421944531856 0.79517653036736813 0.82349483853665706 0.84800171239977029 0.87060343698000509 0.8926585878364055 0.91564064037500359 0.94236628831579039 1 1
+pdf.values = 0 Inf 0.73945866441064423 0.42030365546132503 0.31194426631760319 0.26007915135164533 0.23306504907381986 0.22114088115723446 0.22227278617271659 0.24140105881383236 0.30705551227436928 Inf 0
+sf.values = 1 1 0.29516637794877887 0.24069578055468144 0.20482346963263187 0.17650516146334294 0.15199828760022974 0.12939656301999489 0.10734141216359451 0.084359359624996383 0.057633711684209582 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.20.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.20.properties
index b2c9d57..8694520 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.20.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.20.properties
@@ -19,7 +19,7 @@ mean = 0.33333333333333331
 variance = 0.031746031746031744
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 0.081459999999999991 0.26272000000000001 0.47177999999999987 0.6630400000000003 0.81250000000000011 0.91295999999999999 0.96921999999999997 0.99328000000000005 0.99953999999999998 1 1
 pdf.values = 0 0 1.458 2.0479999999999996 2.0579999999999994 1.7279999999999998 1.25 0.7679999999999999 0.378 0.12799999999999995 0.017999999999999985 0 0
-sf.values = 1 1 0.918540000000000 0.737280000000000 0.528220000000000 0.336960000000000 0.187500000000000 0.0870400000000000  0.0307800000000000  0.00671999999999999 0.000460000000000000  0 0
+sf.values = 1 1 0.91854000000000002 0.73727999999999994 0.52822000000000013 0.33695999999999976 0.18749999999999992 0.087040000000000006 0.030780000000000002 0.0067199999999999925 0.00045999999999999969 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.21.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.21.properties
index 9d87d65..9f80546 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.21.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.21.properties
@@ -19,7 +19,7 @@ mean = 0.97560975609756106
 variance = 0.0046657568440820708
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 3.2171282691062582e-06 5.5920702707254974e-05 0.00031043754736771468 0.0010887195953766145 0.002995933980950227 0.0071555887773963782 0.015771491525200323 0.033804105852091329 0.076500887893677594 1 1
 pdf.values = 0 0 0.00013122124829656863 0.001167162759255986 0.0044421984013840775 0.012096682222928267 0.027839371884979505 0.058806073487464187 0.12097828236031892 0.26011499456731058 0.69111441539656093 Inf 0
-sf.values = 1 1 0.999996782871731 0.999944079297293 0.999689562452632 0.998911280404623 0.997004066019050 0.992844411222604 0.984228508474800 0.966195894147909 0.923499112106322 0 0
+sf.values = 1 1 0.99999678287173088 0.99994407929729279 0.9996895624526323 0.9989112804046234 0.99700406601904978 0.99284441122260358 0.9842285084747997 0.96619589414790863 0.92349911210632241 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.22.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.22.properties
index 19381c2..749e340 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.22.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.22.properties
@@ -19,7 +19,7 @@ mean = 0.88888888888888884
 variance = 0.017957351290684626
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 2.8511148630298162e-05 0.00047761405759400596 0.002544374616406807 0.0085162633709012919 0.022203904140477276 0.049735563119401985 0.10122151579386635 0.1950155281000755 0.37337491740225981 1 1
 pdf.values = 0 0 0.0011529137302697221 0.0097827974015615871 0.035296594869406304 0.090369611411506442 0.19334951048069668 0.37354404860738988 0.68493846904682498 1.2521980673998829 2.5214223280998826 Inf 0
-sf.values = 1 1 0.999971488851370 0.999522385942406 0.997455625383593 0.991483736629099 0.977796095859523 0.950264436880598 0.898778484206134 0.804984471899925 0.626625082597740 0 0
+sf.values = 1 1 0.99997148885136966 0.99952238594240594 0.99745562538359323 0.99148373662909872 0.97779609585952276 0.95026443688059803 0.89877848420613371 0.8049844718999245 0.62662508259774019 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.23.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.23.properties
index cdc9362..b1e4667 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.23.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.23.properties
@@ -16,10 +16,10 @@
 parameters = 4.0 1.0
 # Computed using Matlab
 mean = 0.80000000000000004
-variance = 0.026666666666666672
+variance = 0.026666666666666668
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 0.00010000000000000006 0.0016000000000000007 0.0080999999999999944 0.025600000000000001 0.062500000000000028 0.12959999999999997 0.24009999999999992 0.40960000000000019 0.65610000000000024 1 1
 pdf.values = 0 0 0.0040000000000000018 0.032000000000000021 0.10799999999999996 0.25600000000000012 0.50000000000000022 0.8640000000000001 1.3719999999999999 2.0480000000000005 2.9160000000000008 4 0
-sf.values = 1 1 0.999900000000000 0.998400000000000 0.991900000000000 0.974400000000000 0.937500000000000 0.870400000000000 0.759900000000000 0.590400000000000 0.343900000000000 0 0
+sf.values = 1 1 0.99990000000000001 0.99839999999999995 0.9919 0.97440000000000004 0.9375 0.87040000000000006 0.75990000000000002 0.59039999999999981 0.34389999999999976 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.24.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.24.properties
index d782b4e..9c28704 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.24.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.24.properties
@@ -19,7 +19,7 @@ mean = 0.66666666666666663
 variance = 0.031746031746031744
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 0.00046000000000000056 0.0067200000000000037 0.030779999999999971 0.087040000000000006 0.18749999999999992 0.33695999999999976 0.52822000000000002 0.73728000000000005 0.91854000000000002 1 1
 pdf.values = 0 0 0.018000000000000016 0.12800000000000006 0.37799999999999967 0.7679999999999999 1.25 1.7279999999999998 2.0579999999999994 2.0479999999999996 1.4579999999999993 0 0
-sf.values = 1 1 0.999540000000000 0.993280000000000 0.969220000000000 0.912960000000000 0.812500000000000 0.663040000000000 0.471780000000000 0.262720000000000 0.0814600000000000  0 0
+sf.values = 1 1 0.99953999999999998 0.99327999999999994 0.96922000000000008 0.91295999999999999 0.81250000000000011 0.6630400000000003 0.47177999999999998 0.26271999999999995 0.081459999999999949 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.25.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.25.properties
index 8211a13..2515bf1 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.25.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.25.properties
@@ -19,7 +19,7 @@ mean = 0.5
 variance = 0.027777777777777776
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
 cdf.values = 0 0 0.0027280000000000021 0.033344000000000061 0.12603599999999995 0.28979200000000022 0.49999999999999967 0.71020799999999973 0.87396399999999996 0.96665599999999996 0.99727200000000005 1 1
 pdf.values = 0 0 0.10206000000000011 0.57344000000000062 1.2965399999999996 1.9353600000000017 2.1875000000000018 1.9353600000000017 1.2965400000000007 0.57344000000000017 0.10206000000000001 0 0
-sf.values = 1 1 0.997272000000000 0.966656000000000 0.873964000000000 0.710208000000000 0.500000000000000 0.289792000000000 0.126036000000000 0.0333440000000000  0.00272800000000000 0 0
+sf.values = 1 1 0.99727200000000005 0.96665599999999996 0.87396400000000007 0.71020799999999973 0.50000000000000033 0.28979200000000022 0.12603600000000006 0.033343999999999999 0.0027279999999999974 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.3.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.3.properties
index f0a3f7d..b438150 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.3.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.3.properties
@@ -15,11 +15,11 @@
 
 parameters = 0.1 1.0
 # Computed using Matlab
-mean = 0.090909090909091
-variance = 0.039354584809130
+mean = 0.090909090909090912
+variance = 0.039354584809130261
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0  0 0.794328234724282 0.851339922520785 0.886568150565213 0.912443536555481 0.933032991536807 0.950200216505676 0.964961095119818 0.977932768542929 0.989519258206214 1 1
-pdf.values = 0  Infinity 0.794328234724282 0.425669961260392 0.295522716855071 0.228110884138870 0.186606598307362 0.158366702750946 0.137851585017117 0.122241596067866 0.109946584245135 0.100000000000000 0
-sf.values = 1 1 0.205671765275719 0.148660077479215 0.113431849434787 0.0875564634445192  0.0669670084631926  0.0497997834943236  0.0350389048801824  0.0220672314570715  0.0104807417937856  0 0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.79432823472428149 0.85133992252078461 0.88656815056521332 0.91244353655548083 0.93303299153680741 0.95020021650567643 0.96496109511981765 0.97793276854292854 0.98951925820621445 1 1
+pdf.values = 0 Inf 0.79432823472428149 0.42566996126039236 0.2955227168550712 0.22811088413887023 0.18660659830736154 0.15836670275094611 0.13785158501711683 0.1222415960678661 0.10994658424513494 0.10000000000000001 0
+sf.values = 1 1 0.20567176527571851 0.14866007747921539 0.11343184943478668 0.087556463444519186 0.066967008463192548 0.049799783494323582 0.035038904880182402 0.022067231457071495 0.010480741793785605 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.4.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.4.properties
index f0ba541..06c4822 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.4.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.4.properties
@@ -15,11 +15,11 @@
 
 parameters = 0.1 2.0
 # Computed using Matlab
-mean = 0.047619047619048
-variance = 0.014629507717065
+mean = 0.047619047619047616
+variance = 0.01462950771706532
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0  0 0.865817775849467 0.919447116322448 0.948627921104778 0.967190148748810 0.979684641113648 0.988208225165904 0.993909927973412 0.997491423913787 0.999414450788277 1 1
-pdf.values = 0  Infinity 0.786384952377039 0.374589565909146 0.227552491978405 0.150553183531654 0.102633629069049 0.0696813492104163  0.0454910230556486  0.0268931511349305  0.0120941242669649  0 0
-sf.values = 1 1 0.134182224150533 0.0805528836775524  0.0513720788952217  0.0328098512511903  0.0203153588863522  0.0117917748340966  0.00609007202658787 0.00250857608621292 0.000585549211723463  0 0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.86581777584946706 0.91944711632244758 0.94862792110477834 0.96719014874880971 0.97968464111364773 0.98820822516590345 0.99390992797341216 0.99749142391378709 0.99941445078827651 1 1
+pdf.values = 0 Inf 0.78638495237703898 0.37458956590914549 0.22755249197840488 0.15055318353165442 0.10263362906904888 0.069681349210416327 0.045491023055648561 0.026893151134930546 0.012094124266964851 0 0
+sf.values = 1 1 0.13418222415053294 0.080552883677552423 0.051372078895221711 0.032809851251190306 0.020315358886352223 0.011791774834096561 0.0060900720265878745 0.0025085760862129194 0.0005855492117234634 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.5.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.5.properties
index 9194496..07c4928 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.5.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.5.properties
@@ -15,11 +15,11 @@
 
 parameters = 0.1 4.0
 # Computed using Matlab
-mean = 0.024390243902439
-variance = 0.004665756844082
+mean = 0.024390243902439029
+variance = 0.0046657568440820708
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0  0 0.923499112106323 0.966195894147909 0.984228508474800 0.992844411222604 0.997004066019050 0.998911280404623 0.999689562452632 0.999944079297293 0.999996782871731 1 1
-pdf.values = 0  Infinity 0.691114415396561 0.260114994567311 0.120978282360319 0.0588060734874642  0.0278393718849795  0.0120966822229283  0.00444219840138409 0.00116716275925599 0.000131221248296568  0 0
-sf.values = 1 1 0.0765008878936770  0.0338041058520913  0.0157714915252003  0.00715558877739638 0.00299593398095023 0.00108871959537661 0.000310437547367715  5.59207027072550e-05  3.21712826910625e-06  0 0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.92349911210632296 0.96619589414790863 0.9842285084747997 0.99284441122260358 0.99700406601904978 0.9989112804046234 0.9996895624526323 0.99994407929729279 0.99999678287173088 1 1
+pdf.values = 0 Inf 0.6911144153965606 0.26011499456731052 0.12097828236031892 0.058806073487464187 0.027839371884979505 0.012096682222928267 0.0044421984013840853 0.0011671627592559851 0.00013122124829656841 0 0
+sf.values = 1 1 0.076500887893677039 0.033804105852091329 0.015771491525200323 0.0071555887773963782 0.002995933980950227 0.0010887195953766145 0.00031043754736771479 5.5920702707254981e-05 3.2171282691062514e-06 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.6.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.6.properties
index aeaacde..9ec6aff 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.6.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.6.properties
@@ -15,11 +15,11 @@
 
 parameters = 0.5 0.1
 # Computed using Matlab
-mean = 0.833333333333333
-variance = 0.086805555555556
+mean = 0.83333333333333337
+variance = 0.086805555555555566
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0  0 0.0576337116842096  0.0843593596249964  0.107341412163594 0.129396563019995 0.151998287600230 0.176505161463343 0.204823469632632 0.240695780554681 0.295166377948779 1 1
-pdf.values = 0  Infinity 0.307055512274369 0.241401058813832 0.222272786172717 0.221140881157234 0.233065049073820 0.260079151351645 0.311944266317603 0.420303655461325 0.739458664410645 Infinity 0
-sf.values = 1 1 0.942366288315790 0.915640640375004 0.892658587836406 0.870603436980005 0.848001712399770 0.823494838536657 0.795176530367368 0.759304219445319 0.704833622051221 0 0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.057633711684209617 0.084359359624996397 0.10734141216359447 0.12939656301999489 0.15199828760022974 0.17650516146334294 0.20482346963263176 0.24069578055468144 0.29516637794877887 1 1
+pdf.values = 0 Inf 0.30705551227436922 0.24140105881383231 0.22227278617271662 0.22114088115723446 0.23306504907381986 0.26007915135164533 0.31194426631760319 0.42030365546132514 0.73945866441064467 Inf 0
+sf.values = 1 1 0.94236628831579039 0.91564064037500359 0.8926585878364055 0.87060343698000509 0.84800171239977029 0.82349483853665706 0.79517653036736824 0.75930421944531856 0.70483362205122113 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.7.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.7.properties
index d4c3cc0..281a1b0 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.7.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.7.properties
@@ -19,7 +19,7 @@ mean = 0.5
 variance = 0.125
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0  0 0.204832764699133 0.295167235300867 0.369010119565545 0.435905783151025 0.500000000000000 0.564094216848975 0.630989880434455 0.704832764699133 0.795167235300867 1 1
-pdf.values = 0  Infinity 1.06103295394597  0.795774715459477 0.694609118042857 0.649747334361397 0.636619772367582 0.649747334361397 0.694609118042857 0.795774715459477 1.06103295394597  Infinity 0
-sf.values = 1 1 0.795167235300867 0.704832764699133 0.630989880434455 0.564094216848975 0.500000000000000 0.435905783151025 0.369010119565545 0.295167235300867 0.204832764699133 0 0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.20483276469913342 0.29516723530086691 0.3690101195655453 0.43590578315102529 0.50000000000000011 0.56409421684897465 0.6309898804344547 0.70483276469913303 0.79516723530086675 1 1
+pdf.values = 0 Inf 1.0610329539459691 0.79577471545947676 0.69460911804285685 0.64974733436139687 0.63661977236758149 0.64974733436139687 0.69460911804285674 0.79577471545947687 1.0610329539459693 Inf 0
+sf.values = 1 1 0.79516723530086653 0.70483276469913303 0.6309898804344547 0.56409421684897465 0.49999999999999989 0.43590578315102529 0.36901011956554536 0.29516723530086691 0.20483276469913331 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.8.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.8.properties
index 5f1c437..ff9d4a3 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.8.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.8.properties
@@ -15,11 +15,11 @@
 
 parameters = 0.5 1.0
 # Computed using Matlab
-mean = 0.333333333333333
-variance = 0.088888888888889
+mean = 0.33333333333333331
+variance = 0.088888888888888892
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0  0 0.316227766016838 0.447213595499958 0.547722557505166 0.632455532033676 0.707106781186547 0.774596669241483 0.836660026534075 0.894427190999916 0.948683298050514 1 1
-pdf.values = 0  Infinity 1.58113883008419  1.11803398874990  0.912870929175277 0.790569415042095 0.707106781186548 0.645497224367903 0.597614304667197 0.559016994374948 0.527046276694730 0.500000000000000 0
-sf.values = 1 1 0.683772233983162 0.552786404500042 0.452277442494834 0.367544467966324 0.292893218813453 0.225403330758517 0.163339973465925 0.105572809000084 0.0513167019494862  0 0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.31622776601683805 0.44721359549995793 0.54772255750516619 0.63245553203367599 0.70710678118654724 0.7745966692414834 0.83666002653407534 0.89442719099991586 0.94868329805051377 1 1
+pdf.values = 0 Inf 1.5811388300841898 1.1180339887498949 0.91287092917527701 0.79056941504209488 0.70710678118654768 0.64549722436790291 0.59761430466719689 0.55901699437494745 0.52704627669472992 0.5 0
+sf.values = 1 1 0.683772233983162 0.55278640450004213 0.45227744249483381 0.36754446796632401 0.2928932188134527 0.22540333075851654 0.16333997346592463 0.1055728090000841 0.051316701949486225 0 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.9.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.9.properties
index 4f096f6..2cd8b57 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.9.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.beta.9.properties
@@ -15,11 +15,11 @@
 
 parameters = 0.5 2.0
 # Computed using Matlab
-mean = 0.200000000000000
-variance = 0.045714285714286
+mean = 0.20000000000000001
+variance = 0.045714285714285714
 lower = 0
 upper = 1
-cdf.points = -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1
-cdf.values = 0  0 0.458530260724415 0.626099033699941 0.739425452631974 0.822192191643779 0.883883476483184 0.929516003089780 0.962159030514187 0.983869910099907 0.996117462953040 1 1
-pdf.values = 0  Inf 2.13453742061366  1.34164078649987  0.958514475634041 0.711512473537885 0.530330085889911 0.387298334620742 0.268926437100239 0.167705098312484 0.0790569415042095  0 0
-sf.values = 1 1 0.541469739275585 0.373900966300059 0.260574547368026 0.177807808356221 0.116116523516816 0.0704839969102200  0.0378409694858131  0.0161300899000925  0.00388253704696051 0 0
+cdf.points = -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1
+cdf.values = 0 0 0.45853026072441505 0.62609903369994102 0.73942545263197434 0.82219219164377877 0.88388347648318444 0.92951600308978 0.96215903051418694 0.98386991009990743 0.99611746295303949 1 1
+pdf.values = 0 Inf 2.1345374206136558 1.3416407864998741 0.9585144756340408 0.71151247353788538 0.53033008588991071 0.38729833462074181 0.26892643710023867 0.16770509831248423 0.079056941504209458 0 0
+sf.values = 1 1 0.54146973927558495 0.37390096630005898 0.26057454736802566 0.17780780835622126 0.1161165235168156 0.070483996910219962 0.037840969485813107 0.016130089900092535 0.0038825370469605072 0 0