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/11/28 14:02:44 UTC

[commons-statistics] branch master updated (f1e0c0d -> c6e644b)

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

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


    from f1e0c0d  Reinstate previously failing test
     new bf13f69  Support per-test properties (tolerance, disable)
     new 76580e6  Assert the high-precision probabilities
     new 2899bb3  Add inverse mapping test for high precision values
     new c6e644b  Update test tolerances

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../BaseContinuousDistributionTest.java            | 212 +++++++------
 .../distribution/BaseDiscreteDistributionTest.java | 231 ++++++++------
 .../distribution/BaseDistributionTest.java         | 347 +++++----------------
 .../distribution/BetaDistributionTest.java         |  10 +-
 .../distribution/CauchyDistributionTest.java       |   5 +
 .../distribution/DistributionTestData.java         | 277 +++++++---------
 .../distribution/GeometricDistributionTest.java    |   5 +
 .../distribution/GumbelDistributionTest.java       |   5 +
 .../HypergeometricDistributionTest.java            |   9 +-
 .../distribution/LaplaceDistributionTest.java      |   5 +
 .../distribution/LevyDistributionTest.java         |  10 +-
 .../distribution/LogNormalDistributionTest.java    |  11 +-
 .../distribution/LogisticDistributionTest.java     |  12 +-
 .../distribution/NakagamiDistributionTest.java     |  10 +-
 .../distribution/NormalDistributionTest.java       |  10 -
 .../distribution/ParetoDistributionTest.java       |  89 ++++--
 .../distribution/PascalDistributionTest.java       |   5 +
 .../distribution/PoissonDistributionTest.java      |   2 +-
 .../commons/statistics/distribution/TestName.java  |  84 +++++
 .../distribution/TriangularDistributionTest.java   |   6 +
 .../TruncatedNormalDistributionTest.java           |   5 +
 .../UniformContinuousDistributionTest.java         |  10 +-
 .../UniformDiscreteDistributionTest.java           |   5 +
 .../distribution/WeibullDistributionTest.java      |   5 +
 .../distribution/ZipfDistributionTest.java         |   5 +
 .../distribution/test.binomial.2.properties        |   3 +
 .../distribution/test.binomial.3.properties        |   3 +
 .../distribution/test.cauchy.1.properties          |  28 +-
 .../distribution/test.exponential.1.properties     |  32 +-
 .../statistics/distribution/test.f.6.properties    |   8 +-
 .../distribution/test.geometric.4.properties       |  59 ++++
 .../distribution/test.laplace.1.properties         |  10 +
 .../statistics/distribution/test.levy.1.properties |   3 +
 .../distribution/test.lognormal.3.properties       |   1 -
 .../distribution/test.normal.1.properties          |   6 +
 .../distribution/test.pareto.10.properties         |   2 +-
 .../distribution/test.pareto.11.properties         |   2 +-
 .../distribution/test.pareto.5.properties          |   2 +-
 .../distribution/test.pareto.6.properties          |   2 +-
 .../distribution/test.pareto.7.properties          |   2 +-
 .../distribution/test.pareto.9.properties          |   2 +-
 .../distribution/test.pascal.1.properties          |  15 +-
 .../distribution/test.poisson.3.properties         |   6 +-
 .../statistics/distribution/test.t.1.properties    |   7 +-
 .../statistics/distribution/test.t.10.properties   |   6 +-
 .../statistics/distribution/test.t.4.properties    |   6 +-
 .../statistics/distribution/test.t.5.properties    |   7 +-
 .../statistics/distribution/test.t.6.properties    |   7 +-
 .../statistics/distribution/test.t.7.properties    |   6 +-
 .../statistics/distribution/test.t.8.properties    |   6 +-
 .../statistics/distribution/test.t.9.properties    |   7 +-
 .../distribution/test.trapezoidal.11.properties    |  17 +-
 .../distribution/test.trapezoidal.12.properties    |   7 +-
 .../distribution/test.trapezoidal.3.properties     |   5 +-
 .../distribution/test.trapezoidal.7.properties     |   6 +-
 .../distribution/test.trapezoidal.8.properties     |   5 +-
 .../distribution/test.triangular.1.properties      |   4 +
 .../distribution/test.triangular.2.properties      |   3 +
 .../distribution/test.truncatednormal.1.properties |  20 +-
 .../distribution/test.truncatednormal.2.properties |   4 +
 .../distribution/test.truncatednormal.3.properties |   3 +
 .../distribution/test.truncatednormal.4.properties |   2 -
 .../distribution/test.truncatednormal.5.properties |  12 +-
 .../distribution/test.truncatednormal.6.properties |   9 +-
 .../distribution/test.truncatednormal.7.properties |  14 +-
 .../distribution/test.truncatednormal.8.properties |   3 +
 .../test.uniformcontinuous.1.properties            |  18 +-
 .../test.uniformcontinuous.2.properties            |  14 +-
 .../distribution/test.uniformdiscrete.3.properties |  16 +-
 .../distribution/test.weibull.1.properties         |  29 +-
 .../distribution/test.weibull.6.properties         |  60 ++--
 .../statistics/distribution/test.zipf.1.properties |   8 +-
 .../statistics/distribution/test.zipf.2.properties |   3 +
 .../statistics/distribution/test.zipf.3.properties |  11 +-
 74 files changed, 1041 insertions(+), 845 deletions(-)
 create mode 100644 commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestName.java
 create mode 100644 commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.geometric.4.properties


[commons-statistics] 03/04: Add inverse mapping test for high precision values

Posted by ah...@apache.org.
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 2899bb337eb3143cc67539db2df5f79b96a5b470
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sat Nov 26 15:52:47 2022 +0000

    Add inverse mapping test for high precision values
---
 .../BaseContinuousDistributionTest.java            | 54 ++++++++++++++++++++++
 .../distribution/BaseDiscreteDistributionTest.java | 48 +++++++++++++++++++
 .../commons/statistics/distribution/TestName.java  |  2 +
 .../distribution/test.normal.1.properties          |  2 +
 4 files changed, 106 insertions(+)

diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
index 9dd2059..689e188 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
@@ -340,6 +340,32 @@ abstract class BaseContinuousDistributionTest
                       ContinuousDistributionTestData::getSfPoints);
     }
 
+    /**
+     * Create a stream of arguments containing the distribution to test, the test points
+     * to evaluate the CDF, and the test tolerance. The equality
+     * {@code cdf(x) = cdf(icdf(cdf(x)))} must be true within the tolerance.
+     * This uses the points for the high-precision CDF.
+     *
+     * @return the stream
+     */
+    Stream<Arguments> testCumulativeProbabilityHighPrecisionInverseMapping() {
+        return stream(TestName.CDF_HP_MAPPING,
+                      ContinuousDistributionTestData::getCdfHpPoints);
+    }
+
+    /**
+     * Create a stream of arguments containing the distribution to test, the test points
+     * to evaluate the SF, and the test tolerance. The equality
+     * {@code sf(x) = sf(isf(sf(x)))} must be true within the tolerance.
+     * This uses the points for the high-precision SF.
+     *
+     * @return the stream
+     */
+    Stream<Arguments> testSurvivalProbabilityHighPrecisionInverseMapping() {
+        return stream(TestName.SF_HP_MAPPING,
+                      ContinuousDistributionTestData::getSfHpPoints);
+    }
+
     /**
      * Create a stream of arguments containing the distribution to test, the test points
      * to evaluate the CDF and survival function, and the test tolerance. CDF + SF must equal 1.
@@ -661,6 +687,34 @@ abstract class BaseContinuousDistributionTest
         }
     }
 
+    /**
+     * Test that an inverse mapping of the cumulative probability density values matches
+     * the original point, {@code x = icdf(cdf(x))} using the points for the high-precision
+     * CDF.
+     */
+    @ParameterizedTest
+    @MethodSource
+    final void testCumulativeProbabilityHighPrecisionInverseMapping(
+            ContinuousDistribution dist,
+            double[] points,
+            DoubleTolerance tolerance) {
+        testCumulativeProbabilityInverseMapping(dist, points, tolerance);
+    }
+
+    /**
+     * Test that an inverse mapping of the survival probability density values matches
+     * the original point, {@code x = isf(sf(x))} using the points for the high-precision
+     * SF.
+     */
+    @ParameterizedTest
+    @MethodSource
+    final void testSurvivalProbabilityHighPrecisionInverseMapping(
+            ContinuousDistribution dist,
+            double[] points,
+            DoubleTolerance tolerance) {
+        testSurvivalProbabilityInverseMapping(dist, points, tolerance);
+    }
+
     /**
      * Test that cumulative probability density and survival probability calculations
      * sum to approximately 1.0.
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
index 98fe1a0..dd7f8fe 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
@@ -345,6 +345,28 @@ abstract class BaseDiscreteDistributionTest
                       DiscreteDistributionTestData::getSfPoints);
     }
 
+    /**
+     * Create a stream of arguments containing the distribution to test and
+     * high-precision CDF test points.
+     *
+     * @return the stream
+     */
+    Stream<Arguments> testCumulativeProbabilityHighPrecisionInverseMapping() {
+        return stream(TestName.CDF_HP_MAPPING,
+                      DiscreteDistributionTestData::getCdfHpPoints);
+    }
+
+    /**
+     * Create a stream of arguments containing the distribution to test and
+     * high-precision SF test points.
+     *
+     * @return the stream
+     */
+    Stream<Arguments> testSurvivalProbabilityHighPrecisionInverseMapping() {
+        return stream(TestName.SF_HP_MAPPING,
+                      DiscreteDistributionTestData::getSfHpPoints);
+    }
+
     /**
      * Create a stream of arguments containing the distribution to test, the test points
      * to evaluate the CDF and survival function, and the test tolerance. CDF + SF must equal 1.
@@ -766,6 +788,32 @@ abstract class BaseDiscreteDistributionTest
         }
     }
 
+    /**
+     * Test that an inverse mapping of the cumulative probability density values matches
+     * the original point, {@code x = icdf(cdf(x))} using the points for the high-precision
+     * CDF.
+     */
+    @ParameterizedTest
+    @MethodSource
+    final void testCumulativeProbabilityHighPrecisionInverseMapping(
+            DiscreteDistribution dist,
+            int[] points) {
+        testCumulativeProbabilityInverseMapping(dist, points);
+    }
+
+    /**
+     * Test that an inverse mapping of the survival probability density values matches
+     * the original point, {@code x = isf(sf(x))} using the points for the high-precision
+     * SF.
+     */
+    @ParameterizedTest
+    @MethodSource
+    final void testSurvivalProbabilityHighPrecisionInverseMapping(
+            DiscreteDistribution dist,
+            int[] points) {
+        testSurvivalProbabilityInverseMapping(dist, points);
+    }
+
     /**
      * Test that cumulative probability density and survival probability calculations
      * sum to approximately 1.0.
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestName.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestName.java
index 7d71a8f..a9d3692 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestName.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestName.java
@@ -35,6 +35,8 @@ enum TestName {
     ISF,
     CDF_MAPPING,
     SF_MAPPING,
+    CDF_HP_MAPPING,
+    SF_HP_MAPPING,
     COMPLEMENT,
     CONSISTENCY,
     OUTSIDE_SUPPORT,
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties
index a16a2c9..cdf1651 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties
@@ -65,6 +65,7 @@ sf.values = \
 cdf.hp.points = -10, -10.3
 cdf.hp.values = 2.74122263461107252124815886312e-18, 4.10456525339188007632261800065e-19
 cdf.hp.relative = 1e-14
+cdf.hp.mapping.relative = 5e-14
 
 # E.g.
 # x = sym(14.5)
@@ -78,3 +79,4 @@ cdf.hp.relative = 1e-14
 sf.hp.points = 14.5, 13.9
 sf.hp.values = 4.10456525339190342717686865166e-19, 1.74955280069751640746342569694e-17
 sf.hp.relative = 1e-14
+sf.hp.mapping.relative = 5e-14


[commons-statistics] 02/04: Assert the high-precision probabilities

Posted by ah...@apache.org.
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 76580e6a5e15a3ca0cbde7c866de89cf0123e9e7
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sat Nov 26 15:35:44 2022 +0000

    Assert the high-precision probabilities
    
    Add a check that the p-values are small such that (1 - p) ~ 1.
    
    Add a check that the tolerance is configured to separate small values.
    
    Fix Weibull and Pareto distribution tests of high precision.
---
 .../BaseContinuousDistributionTest.java            | 10 +--
 .../distribution/BaseDiscreteDistributionTest.java | 10 +--
 .../distribution/BaseDistributionTest.java         | 30 +++++++++
 .../distribution/ParetoDistributionTest.java       | 75 ++++++++++++++--------
 .../distribution/test.weibull.1.properties         |  2 +
 5 files changed, 93 insertions(+), 34 deletions(-)

diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
index a9831d4..9dd2059 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
@@ -510,8 +510,8 @@ abstract class BaseContinuousDistributionTest
     }
 
     /**
-     * Test that CDF is simply not 1-survival function by testing values that would result
-     * with inaccurate results if simply calculating 1-survival function.
+     * Test that cumulative probability is not {@code (1 - survival probability)} by testing values
+     * that would result in inaccurate results if simply calculating (1 - sf).
      */
     @ParameterizedTest
     @MethodSource
@@ -519,12 +519,13 @@ abstract class BaseContinuousDistributionTest
                                                       double[] points,
                                                       double[] values,
                                                       DoubleTolerance tolerance) {
+        assertHighPrecision(tolerance, values);
         testCumulativeProbability(dist, points, values, tolerance);
     }
 
     /**
-     * Test that survival is simply not 1-cdf by testing calculations that would underflow
-     * that calculation and result in an inaccurate answer.
+     * Test that survival probability is not {@code (1 - cumulative probability)} by testing values
+     * that would result in inaccurate results if simply calculating (1 - cdf).
      */
     @ParameterizedTest
     @MethodSource
@@ -532,6 +533,7 @@ abstract class BaseContinuousDistributionTest
                                                     double[] points,
                                                     double[] values,
                                                     DoubleTolerance tolerance) {
+        assertHighPrecision(tolerance, values);
         testSurvivalProbability(dist, points, values, tolerance);
     }
 
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
index c38483a..98fe1a0 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
@@ -542,8 +542,8 @@ abstract class BaseDiscreteDistributionTest
     }
 
     /**
-     * Test that CDF is simply not 1-survival function by testing values that would result
-     * with inaccurate results if simply calculating 1-survival function.
+     * Test that cumulative probability is not {@code (1 - survival probability)} by testing values
+     * that would result in inaccurate results if simply calculating (1 - sf).
      */
     @ParameterizedTest
     @MethodSource
@@ -551,12 +551,13 @@ abstract class BaseDiscreteDistributionTest
                                                       int[] points,
                                                       double[] values,
                                                       DoubleTolerance tolerance) {
+        assertHighPrecision(tolerance, values);
         testCumulativeProbability(dist, points, values, tolerance);
     }
 
     /**
-     * Test that survival is simply not 1-cdf by testing calculations that would underflow
-     * that calculation and result in an inaccurate answer.
+     * Test that survival probability is not {@code (1 - cumulative probability)} by testing values
+     * that would result in inaccurate results if simply calculating (1 - cdf).
      */
     @ParameterizedTest
     @MethodSource
@@ -564,6 +565,7 @@ abstract class BaseDiscreteDistributionTest
                                                     int[] points,
                                                     double[] values,
                                                     DoubleTolerance tolerance) {
+        assertHighPrecision(tolerance, values);
         testSurvivalProbability(dist, points, values, tolerance);
     }
 
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java
index e669a3a..622c128 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java
@@ -558,6 +558,36 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
         return b.build();
     }
 
+    /**
+     * Assert the probabilities require a high-precision computation. This verifies
+     * the approximation {@code (1 - p) ~ 1}. The tolerance is set at 2 ULP for the
+     * smallest p-value.
+     *
+     * <p>The test tolerance is verified that it can distinguish values a and b when
+     * separated by an absolute distance of 2 EPSILON (4.44e-16). This is a quick
+     * check to ensure any tests that have overridden the default absolute tolerance
+     * of 0 have correctly configured the absolute tolerance for the high-precision
+     * probabilities (which are expected to have some p-values {@code < 1e-16}).
+     *
+     * @param tolerance Test tolerance
+     * @param probabilities Probabilities
+     */
+    void assertHighPrecision(DoubleTolerance tolerance, double... probabilities) {
+        final double b = 2 * RELATIVE_EPS;
+        Assertions.assertFalse(tolerance.test(0.0, b),
+            () -> "Test tolerance cannot separate small values 0.0 and " + b + ": " + tolerance);
+
+        final long one = Double.doubleToRawLongBits(1.0);
+        final double expected = 2;
+        final int[] ulps = Arrays.stream(probabilities)
+                                 .mapToInt(p -> (int) (one - Double.doubleToRawLongBits(1.0 - p)))
+                                 .toArray();
+        final double min = Arrays.stream(ulps).min().orElse(0);
+        Assertions.assertFalse(min < 0, () -> "Invalid probability above 1.0: " + Arrays.toString(probabilities));
+        Assertions.assertTrue(min <= expected,
+            () -> "Not high-precision p-values: (1 - p) ulps from 1 = " + Arrays.toString(ulps));
+    }
+
     /**
      * Create arguments to test invalid parameters of the distribution. Each Object[]
      * will be expected to raise an exception when passed to the {@link #makeDistribution(Object...)}
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java
index 0988410..7ee9202 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java
@@ -79,12 +79,55 @@ class ParetoDistributionTest extends BaseContinuousDistributionTest {
 
     @Test
     void testAdditionalCumulativeProbabilityHighPrecision() {
-        final ParetoDistribution dist = ParetoDistribution.of(2.1, 1.4);
-        testCumulativeProbabilityHighPrecision(
-            dist,
-            new double[] {2.100000000000001, 2.100000000000005},
-            new double[] {6.217248937900875e-16, 3.2640556923979585e-15},
-            DoubleTolerances.relative(5e-14));
+        final double scale = 2.1;
+        // 2.1000000000000005, 2.100000000000001
+        final double[] x = {Math.nextUp(scale), Math.nextUp(Math.nextUp(scale))};
+
+        // R and Wolfram alpha do not match for high precision CDF at small x.
+        // The answers were computed using BigDecimal with a math context precision of 100.
+        // Note that the results using double are limited by intermediate rounding and the
+        // CDF is not high precision as the number of bits of accuracy is low:
+        //
+        // x = Math.nextUp(scale)
+        // 1.0 - pow(scale/x, 0.75)                    ==> 1.1102230246251565E-16
+        // -expm1(shape * log(scale/x))                ==> 1.665334536937735E-16
+        // -expm1(shape * log(scale) - shape * log(x)) ==> 2.2204460492503128E-16
+        //
+        // x = Math.nextUp(Math.nextUp(scale))
+        // 1.0 - pow(scale/x, 0.75)                    ==> 3.3306690738754696E-16
+        // -expm1(shape * log(scale/x))                ==> 3.33066907387547E-16
+        // -expm1(shape * log(scale) - shape * log(x)) ==> 4.440892098500625E-16
+
+        final ParetoDistribution dist = ParetoDistribution.of(scale, 0.75);
+        // BigDecimal: 1 - (scale/x).pow(3).sqrt().sqrt()
+        // MathContext mc = new MathContext(100)
+        // BigDecimal.ONE.subtract(
+        //   new BigDecimal(2.1).divide(new BigDecimal(Math.nextUp(Math.nextUp(2.1))), mc)
+        //    .pow(3).sqrt(mc).sqrt(mc)).doubleValue()
+        final double[] values = {1.5860328923216517E-16, 3.172065784643303E-16};
+        testCumulativeProbabilityHighPrecision(dist, x, values, createRelTolerance(0.05));
+    }
+
+    @Test
+    void testAdditionalCumulativeProbabilityHighPrecision2() {
+        final double scale = 3;
+        // 3.0000000000000004, 3.000000000000001
+        final double[] x = {Math.nextUp(scale), Math.nextUp(Math.nextUp(scale))};
+
+        // The current implementation is closer to the answer than either R or Wolfram but
+        // the relative error is typically 0.25 (error in the first or second digit).
+        // The absolute tolerance checks the result to a closer tolerance than
+        // the answer computed using 1 - Math.pow(scale/x, shape), which is zero.
+
+        final ParetoDistribution dist = ParetoDistribution.of(3, 0.25);
+        // BigDecimal: 1 - (scale/x).sqrt().sqrt()
+        final double[] values = {3.700743415417188E-17, 7.401486830834375E-17};
+        testCumulativeProbabilityHighPrecision(dist, x, values, createAbsTolerance(1e-17));
+
+        final ParetoDistribution dist2 = ParetoDistribution.of(3, 1.5);
+        // BigDecimal: 1 - (scale/x).pow(3).sqrt()
+        final double[] values2 = {2.2204460492503126E-16, 4.4408920985006247E-16};
+        testCumulativeProbabilityHighPrecision(dist2, x, values2, createAbsTolerance(6e-17));
     }
 
     @Test
@@ -97,26 +140,6 @@ class ParetoDistributionTest extends BaseContinuousDistributionTest {
             DoubleTolerances.relative(5e-14));
     }
 
-    @Test
-    void testAdditionalCumulativeProbabilityHighPrecision2() {
-        final double[] x = {3.000000000000001, 3.000000000000005};
-
-        // R and Wolfram alpha do not match for high precision CDF at small x.
-        // The answers were computed using BigDecimal with a math context precision of 100.
-        // The current implementation is closer to the answer than either R or Wolfram but
-        // the tolerance is quite high as the error is typically in the second significant digit.
-
-        final ParetoDistribution dist = ParetoDistribution.of(3, 0.5);
-        // BigDecimal: 1 - (scale/x).sqrt()
-        final double[] values = {1.480297366166875E-16, 8.141635513917804E-16};
-        testCumulativeProbabilityHighPrecision(dist, x, values, createAbsTolerance(2e-17));
-
-        final ParetoDistribution dist2 = ParetoDistribution.of(3, 2);
-        // BigDecimal: 1 - (scale/x).pow(2)
-        final double[] values2 = {5.921189464667499E-16, 3.256654205567118E-15};
-        testCumulativeProbabilityHighPrecision(dist2, x, values2, createAbsTolerance(8e-17));
-    }
-
     /**
      * Check to make sure top-coding of extreme values works correctly.
      */
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.1.properties
index 3021729..f1cf0f4 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.1.properties
@@ -32,5 +32,7 @@ pdf.values = \
 # Computed using WolframAlpha
 cdf.hp.points = 1e-14, 1e-15
 cdf.hp.values = 6.506341377907031e-18, 4.1052238780858223e-19
+cdf.hp.absolute = 0
 sf.hp.points = 45, 47.2
 sf.hp.values = 6.6352694710268576e-18, 6.444810903667567e-19
+sf.hp.absolute = 0


[commons-statistics] 04/04: Update test tolerances

Posted by ah...@apache.org.
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 c6e644b80bcc63b2e31cbee7def42562b23a6807
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Nov 28 13:54:05 2022 +0000

    Update test tolerances
    
    Use per-test tolerance to isolate limits in computation accuracy.
    
    Update default tolerance from 1e12 to 1e14.
---
 .../BaseContinuousDistributionTest.java            |  2 +-
 .../distribution/BaseDiscreteDistributionTest.java |  2 +-
 .../distribution/BaseDistributionTest.java         |  4 +-
 .../distribution/BetaDistributionTest.java         | 10 ++--
 .../distribution/CauchyDistributionTest.java       |  5 ++
 .../distribution/GeometricDistributionTest.java    |  5 ++
 .../distribution/GumbelDistributionTest.java       |  5 ++
 .../HypergeometricDistributionTest.java            |  5 ++
 .../distribution/LaplaceDistributionTest.java      |  5 ++
 .../distribution/LevyDistributionTest.java         | 10 ++--
 .../distribution/LogNormalDistributionTest.java    | 11 ++--
 .../distribution/LogisticDistributionTest.java     | 12 ++---
 .../distribution/NakagamiDistributionTest.java     | 10 ++--
 .../distribution/ParetoDistributionTest.java       | 12 ++---
 .../distribution/PascalDistributionTest.java       |  5 ++
 .../distribution/TriangularDistributionTest.java   |  6 +++
 .../TruncatedNormalDistributionTest.java           |  5 ++
 .../UniformContinuousDistributionTest.java         | 10 ++--
 .../UniformDiscreteDistributionTest.java           |  5 ++
 .../distribution/WeibullDistributionTest.java      |  5 ++
 .../distribution/ZipfDistributionTest.java         |  5 ++
 .../distribution/test.binomial.2.properties        |  2 +
 .../distribution/test.binomial.3.properties        |  2 +
 .../distribution/test.cauchy.1.properties          | 28 ++++++----
 .../distribution/test.exponential.1.properties     | 32 ++++++++----
 .../statistics/distribution/test.f.6.properties    |  8 ++-
 .../distribution/test.geometric.4.properties       | 59 +++++++++++++++++++++
 .../distribution/test.laplace.1.properties         | 10 ++++
 .../statistics/distribution/test.levy.1.properties |  4 +-
 .../distribution/test.lognormal.3.properties       |  1 -
 .../distribution/test.normal.1.properties          |  6 ++-
 .../distribution/test.pascal.1.properties          | 15 ++++--
 .../distribution/test.poisson.3.properties         |  6 ++-
 .../statistics/distribution/test.t.1.properties    |  7 ++-
 .../statistics/distribution/test.t.10.properties   |  6 ++-
 .../statistics/distribution/test.t.4.properties    |  6 ++-
 .../statistics/distribution/test.t.5.properties    |  7 ++-
 .../statistics/distribution/test.t.6.properties    |  7 ++-
 .../statistics/distribution/test.t.7.properties    |  6 ++-
 .../statistics/distribution/test.t.8.properties    |  6 ++-
 .../statistics/distribution/test.t.9.properties    |  7 ++-
 .../distribution/test.trapezoidal.11.properties    | 17 +++---
 .../distribution/test.trapezoidal.12.properties    |  7 +--
 .../distribution/test.trapezoidal.3.properties     |  5 +-
 .../distribution/test.trapezoidal.7.properties     |  6 ++-
 .../distribution/test.trapezoidal.8.properties     |  5 +-
 .../distribution/test.triangular.1.properties      |  4 ++
 .../distribution/test.triangular.2.properties      |  3 ++
 .../distribution/test.truncatednormal.1.properties | 20 ++++++--
 .../distribution/test.truncatednormal.2.properties |  4 ++
 .../distribution/test.truncatednormal.3.properties |  3 ++
 .../distribution/test.truncatednormal.4.properties |  2 -
 .../distribution/test.truncatednormal.5.properties | 12 ++++-
 .../distribution/test.truncatednormal.6.properties |  9 +++-
 .../distribution/test.truncatednormal.7.properties | 14 ++---
 .../distribution/test.truncatednormal.8.properties |  3 ++
 .../test.uniformcontinuous.1.properties            | 18 ++++---
 .../test.uniformcontinuous.2.properties            | 14 +++--
 .../distribution/test.uniformdiscrete.3.properties | 16 +++---
 .../distribution/test.weibull.1.properties         | 31 +++++++----
 .../distribution/test.weibull.6.properties         | 60 +++++++++++-----------
 .../statistics/distribution/test.zipf.1.properties |  8 ++-
 .../statistics/distribution/test.zipf.2.properties |  3 ++
 .../statistics/distribution/test.zipf.3.properties | 11 +++-
 64 files changed, 456 insertions(+), 183 deletions(-)

diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
index 689e188..5d27d5e 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
@@ -163,7 +163,7 @@ import org.junit.jupiter.params.provider.MethodSource;
  * lower = 0
  * # optional (default Infinity)
  * upper = Infinity
- * # optional (default 1e-12 or over-ridden in getRelativeTolerance())
+ * # optional (default 1e-14 or over-ridden in getRelativeTolerance())
  * tolerance.relative = 1e-9
  * # optional (default 0.0 or over-ridden in getAbsoluteTolerance())
  * tolerance.absolute = 0.0
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
index dd7f8fe..7dad929 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
@@ -162,7 +162,7 @@ import org.junit.jupiter.params.provider.MethodSource;
  * lower = 0
  * # optional (default 2147483647, Integer.MAX_VALUE)
  * upper = max
- * # optional (default 1e-12 or over-ridden in getRelativeTolerance())
+ * # optional (default 1e-14 or over-ridden in getRelativeTolerance())
  * tolerance.relative = 1e-9
  * # optional (default 0.0 or over-ridden in getAbsoluteTolerance())
  * tolerance.absolute = 0.0
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java
index 622c128..2371014 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java
@@ -143,7 +143,7 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
     /**
      * Gets the default relative tolerance used in comparing expected and returned values.
      *
-     * <p>The initial value is 1e-12.
+     * <p>The initial value is 1e-14.
      *
      * <p>Override this method to set the <strong>default</strong> relative tolerance for all test
      * cases defined by a properties file. Any properties file with a relative tolerance entry
@@ -155,7 +155,7 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
      * @return the relative tolerance
      */
     protected double getRelativeTolerance() {
-        return 1e-12;
+        return 1e-14;
     }
 
     /**
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BetaDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BetaDistributionTest.java
index 30ec9fd..30f3c1e 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BetaDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BetaDistributionTest.java
@@ -47,11 +47,6 @@ class BetaDistributionTest extends BaseContinuousDistributionTest {
         return BetaDistribution.of(alpha, beta);
     }
 
-    @Override
-    protected double getRelativeTolerance() {
-        return 8e-15;
-    }
-
     @Override
     Object[][] makeInvalidParameters() {
         return new Object[][] {
@@ -67,6 +62,11 @@ class BetaDistributionTest extends BaseContinuousDistributionTest {
         return new String[] {"Alpha", "Beta"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        return 8e-15;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     /**
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/CauchyDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/CauchyDistributionTest.java
index 7b8688a..b6d7ff1 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/CauchyDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/CauchyDistributionTest.java
@@ -41,4 +41,9 @@ class CauchyDistributionTest extends BaseContinuousDistributionTest {
     String[] getParameterNames() {
         return new String[] {"Location", "Scale"};
     }
+
+    @Override
+    protected double getRelativeTolerance() {
+        return 5e-15;
+    }
 }
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/GeometricDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/GeometricDistributionTest.java
index 1c47922..4fedec1 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/GeometricDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/GeometricDistributionTest.java
@@ -50,6 +50,11 @@ class GeometricDistributionTest extends BaseDiscreteDistributionTest {
         return new String[] {"ProbabilityOfSuccess"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        return 2 * RELATIVE_EPS;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     @ParameterizedTest
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/GumbelDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/GumbelDistributionTest.java
index 1f38784..ac88830 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/GumbelDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/GumbelDistributionTest.java
@@ -40,4 +40,9 @@ class GumbelDistributionTest extends BaseContinuousDistributionTest {
     String[] getParameterNames() {
         return new String[] {"Location", "Scale"};
     }
+
+    @Override
+    protected double getRelativeTolerance() {
+        return 5e-15;
+    }
 }
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/HypergeometricDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/HypergeometricDistributionTest.java
index 64c4ea8..e6016aa 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/HypergeometricDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/HypergeometricDistributionTest.java
@@ -56,6 +56,11 @@ class HypergeometricDistributionTest extends BaseDiscreteDistributionTest {
         return new String[] {"PopulationSize", "NumberOfSuccesses", "SampleSize"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        return 5e-15;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     @ParameterizedTest
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LaplaceDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LaplaceDistributionTest.java
index 0ec4d30..1169a40 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LaplaceDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LaplaceDistributionTest.java
@@ -41,4 +41,9 @@ class LaplaceDistributionTest extends BaseContinuousDistributionTest {
     String[] getParameterNames() {
         return new String[] {"Location", "Scale"};
     }
+
+    @Override
+    protected double getRelativeTolerance() {
+        return 5e-15;
+    }
 }
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LevyDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LevyDistributionTest.java
index f712b1d..67f8b0a 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LevyDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LevyDistributionTest.java
@@ -28,11 +28,6 @@ class LevyDistributionTest  extends BaseContinuousDistributionTest {
         return LevyDistribution.of(location, scale);
     }
 
-    @Override
-    protected double getRelativeTolerance() {
-        return 1e-14;
-    }
-
     @Override
     Object[][] makeInvalidParameters() {
         return new Object[][] {
@@ -45,4 +40,9 @@ class LevyDistributionTest  extends BaseContinuousDistributionTest {
     String[] getParameterNames() {
         return new String[] {"Location", "Scale"};
     }
+
+    @Override
+    protected double getRelativeTolerance() {
+        return 1e-14;
+    }
 }
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LogNormalDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LogNormalDistributionTest.java
index 0e36dcb..e9d4a7a 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LogNormalDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LogNormalDistributionTest.java
@@ -32,12 +32,6 @@ class LogNormalDistributionTest extends BaseContinuousDistributionTest {
         return LogNormalDistribution.of(mu, sigma);
     }
 
-    @Override
-    protected double getRelativeTolerance() {
-        // Limited by the CDF inverse mapping
-        return 1e-9;
-    }
-
     @Override
     Object[][] makeInvalidParameters() {
         return new Object[][] {
@@ -51,6 +45,11 @@ class LogNormalDistributionTest extends BaseContinuousDistributionTest {
         return new String[] {"Mu", "Sigma"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        return 5e-14;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     @Test
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LogisticDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LogisticDistributionTest.java
index 985bde3..fba8a3a 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LogisticDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/LogisticDistributionTest.java
@@ -31,12 +31,6 @@ class LogisticDistributionTest extends BaseContinuousDistributionTest {
         return LogisticDistribution.of(location, scale);
     }
 
-    @Override
-    protected double getRelativeTolerance() {
-        // Limited by the CDF inverse mapping
-        return 1e-9;
-    }
-
     @Override
     Object[][] makeInvalidParameters() {
         return new Object[][] {
@@ -50,6 +44,12 @@ class LogisticDistributionTest extends BaseContinuousDistributionTest {
         return new String[] {"Location", "Scale"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        // Limited by the CDF inverse mapping
+        return 1e-9;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     @Test
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NakagamiDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NakagamiDistributionTest.java
index 41f1101..711cf68 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NakagamiDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NakagamiDistributionTest.java
@@ -34,11 +34,6 @@ class NakagamiDistributionTest extends BaseContinuousDistributionTest {
         return NakagamiDistribution.of(mu, omega);
     }
 
-    @Override
-    protected double getRelativeTolerance() {
-        return 5e-15;
-    }
-
     @Override
     Object[][] makeInvalidParameters() {
         return new Object[][] {
@@ -54,6 +49,11 @@ class NakagamiDistributionTest extends BaseContinuousDistributionTest {
         return new String[] {"Shape", "Scale"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        return 5e-15;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     /**
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java
index 7ee9202..c154b13 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java
@@ -43,12 +43,6 @@ class ParetoDistributionTest extends BaseContinuousDistributionTest {
         return ParetoDistribution.of(scale, shape);
     }
 
-    @Override
-    protected double getRelativeTolerance() {
-        // Limited by CDF inverse mapping test
-        return 1e-9;
-    }
-
     @Override
     Object[][] makeInvalidParameters() {
         return new Object[][] {
@@ -65,6 +59,12 @@ class ParetoDistributionTest extends BaseContinuousDistributionTest {
         return new String[] {"Scale", "Shape"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        // Limited by CDF inverse mapping test
+        return 1e-9;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     @ParameterizedTest
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/PascalDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/PascalDistributionTest.java
index e2847e4..f8f6a07 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/PascalDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/PascalDistributionTest.java
@@ -50,6 +50,11 @@ class PascalDistributionTest extends BaseDiscreteDistributionTest {
         return new String[] {"NumberOfSuccesses", "ProbabilityOfSuccess"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        return 5e-15;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     @ParameterizedTest
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TriangularDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TriangularDistributionTest.java
index 80d2393..83c107b 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TriangularDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TriangularDistributionTest.java
@@ -58,6 +58,12 @@ class TriangularDistributionTest extends BaseContinuousDistributionTest {
         return new String[] {"SupportLowerBound", "Mode", "SupportUpperBound"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        // Tolerance is 4.440892098500626E-15.
+        return 20 * RELATIVE_EPS;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     @ParameterizedTest
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TruncatedNormalDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TruncatedNormalDistributionTest.java
index a05d73c..50d55de 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TruncatedNormalDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TruncatedNormalDistributionTest.java
@@ -57,6 +57,11 @@ class TruncatedNormalDistributionTest extends BaseContinuousDistributionTest {
         return new String[] {null, null, "SupportLowerBound", "SupportUpperBound"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        return 1e-14;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     /**
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/UniformContinuousDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/UniformContinuousDistributionTest.java
index 287d283..fea2b7a 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/UniformContinuousDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/UniformContinuousDistributionTest.java
@@ -41,11 +41,6 @@ class UniformContinuousDistributionTest extends BaseContinuousDistributionTest {
         return UniformContinuousDistribution.of(lower, upper);
     }
 
-    @Override
-    protected double getRelativeTolerance() {
-        return 1e-15;
-    }
-
     @Override
     Object[][] makeInvalidParameters() {
         return new Object[][] {
@@ -63,6 +58,11 @@ class UniformContinuousDistributionTest extends BaseContinuousDistributionTest {
         return new String[] {"SupportLowerBound", "SupportUpperBound"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        return 1e-15;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     @ParameterizedTest
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/UniformDiscreteDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/UniformDiscreteDistributionTest.java
index 33d5ecb..2fb4426 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/UniformDiscreteDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/UniformDiscreteDistributionTest.java
@@ -53,6 +53,11 @@ class UniformDiscreteDistributionTest extends BaseDiscreteDistributionTest {
         return new String[] {"SupportLowerBound", "SupportUpperBound"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        return 1e-15;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     @ParameterizedTest
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/WeibullDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/WeibullDistributionTest.java
index d192420..a6161cf 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/WeibullDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/WeibullDistributionTest.java
@@ -54,6 +54,11 @@ class WeibullDistributionTest extends BaseContinuousDistributionTest {
         return new String[] {"Shape", "Scale"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        return 1e-14;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     @ParameterizedTest
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ZipfDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ZipfDistributionTest.java
index 2a7ff45..aa4e629 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ZipfDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ZipfDistributionTest.java
@@ -53,6 +53,11 @@ class ZipfDistributionTest  extends BaseDiscreteDistributionTest {
         return new String[] {"NumberOfElements", "Exponent"};
     }
 
+    @Override
+    protected double getRelativeTolerance() {
+        return 1e-14;
+    }
+
     //-------------------- Additional test cases -------------------------------
 
     @ParameterizedTest
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.2.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.2.properties
index af855fb..09ceb2d 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.2.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.2.properties
@@ -30,4 +30,6 @@ pmf.values = 1.000000000000088817841970016428095E-200
 # computed using R version 3.4.4
 cdf.hp.points = 82, 81
 cdf.hp.values = 1.4061271955993513664e-17, 6.1128083336354843707e-19
+
+# Overridden tolerances
 cdf.hp.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.3.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.3.properties
index 663d065..12122ef 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.3.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.3.properties
@@ -28,4 +28,6 @@ pmf.values = 1.000000000000002081668171172170658E-200
 # computed using R version 3.4.4
 sf.hp.points = 18, 19
 sf.hp.values = 6.1128083336353977038e-19, 2.4944165604029235392e-20
+
+# Overridden tolerances
 sf.hp.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.cauchy.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.cauchy.1.properties
index f6ad3a7..6df62cf 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.cauchy.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.cauchy.1.properties
@@ -14,20 +14,30 @@
 # limitations under the License.
 
 parameters = 1.2 2.1
-# Low precision test data
-tolerance.relative = 1e-10
-# Computed using R 2.9.2
+# Computed using R 3.4.4
 mean = NaN
 variance = NaN
+# print(qcauchy(c(0.001, 0.01, 0.025, 0.05, 0.1, 0.999, 0.990, 0.975, 0.950, 0.900), 1.2, 2.1), digits=17)
 cdf.points = \
-  -667.24856187, -65.6230835029, -25.4830299460, -12.0588781808,\
-  -5.26313542807, 669.64856187, 68.0230835029, 27.8830299460, 14.4588781808, 7.66313542807
+   -667.2485618696558731  -65.6230835029253114  -25.4830299459668836 \
+    -12.0588781808175938   -5.2631354280680327  669.6485618696553956 \
+     68.0230835029252461   27.8830299459668609   14.4588781808175781 \
+      7.6631354280680348
 cdf.values = \
-  0.001, 0.01, 0.025, 0.05, 0.1, 0.999,\
-  0.990, 0.975, 0.950, 0.900
+   0.001000000000000000 0.010000000000000000 0.025000000000000005 \
+   0.050000000000000003 0.100000000000000006 0.998999999999999999 \
+   0.989999999999999991 0.974999999999999978 0.949999999999999956 \
+   0.900000000000000022
 pdf.values = \
-  1.49599158008e-06, 0.000149550440335, 0.000933076881878, 0.00370933207799, 0.0144742330437,\
-  1.49599158008e-06, 0.000149550440335, 0.000933076881878, 0.00370933207799, 0.0144742330437
+   1.4959915800846831e-06 1.4955044033490212e-04 9.3307688187983481e-04 \
+   3.7093320779828273e-03 1.4474233043702081e-02 1.4959915800846858e-06 \
+   1.4955044033490244e-04 9.3307688187983621e-04 3.7093320779828342e-03 \
+   1.4474233043702074e-02
+sf.values = \
+   0.9989999999999999991 0.9899999999999999911 0.9749999999999999778 \
+   0.9499999999999999556 0.9000000000000000222 0.0010000000000000009 \
+   0.0100000000000000089 0.0250000000000000222 0.0500000000000000444 \
+   0.0999999999999999778
 # Computed using WolframAlpha
 cdf.hp.points = -1e16
 cdf.hp.values = 5.551115123125783e-17
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.exponential.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.exponential.1.properties
index 649528d..f690d96 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.exponential.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.exponential.1.properties
@@ -14,24 +14,38 @@
 # limitations under the License.
 
 parameters = 5.0
-# Limited precision of test data
-tolerance.relative = 1e-10
-# Computed using R 2.9.2
+# Computed using R 3.4.4
 mean = 5.0
 variance = 25.0
 lower = 0
+# print(qexp(c(0.001, 0.01, 0.025, 0.05, 0.1, 0.999, 0.990, 0.975, 0.950, 0.900), 0.2), digits=17)
 cdf.points = \
-  0, 0.00500250166792, 0.0502516792675, 0.126589039921, 0.256466471938,\
-  0.526802578289, 34.5387763949, 23.0258509299, 18.4443972706, 14.9786613678, 11.5129254650
+    0.0050025016679176677  0.0502516792675072113  0.1265890399214493756 \
+    0.2564664719377526825  0.5268025782891315734 34.5387763949106769701 \
+   23.0258509299404501292 18.4443972705696772607 14.9786613677699502745 \
+   11.5129254649702303936
 cdf.values = \
-  0, 0.001, 0.01, 0.025, 0.05, 0.1, 0.999,\
-  0.990, 0.975, 0.950, 0.900
+   0.001000000000000000 0.010000000000000000 0.025000000000000001 \
+   0.050000000000000003 0.100000000000000006 0.998999999999999999 \
+   0.989999999999999991 0.974999999999999978 0.949999999999999956 \
+   0.900000000000000022
 pdf.values = \
-  0.2, 0.1998, 0.198, 0.195, 0.19, 0.18, 0.000200000000000,\
-  0.00200000000002, 0.00499999999997, 0.00999999999994, 0.0199999999999
+   0.19980000000000000537 0.19800000000000000933 0.19500000000000000666 \
+   0.19000000000000000222 0.17999999999999999334 0.00020000000000000039 \
+   0.00200000000000000264 0.00500000000000000444 0.01000000000000001062 \
+   0.01999999999999999695
+sf.values = \
+   0.998999999999999999 0.989999999999999991 0.974999999999999978 \
+   0.949999999999999956 0.900000000000000022 0.001000000000000002 \
+   0.010000000000000014 0.025000000000000022 0.050000000000000051 \
+   0.099999999999999978
+
 # Computed using scipy
 cdf.hp.points = 1e-15, 4e-16, 9e-16
 cdf.hp.values = 2.0000000000000002e-16, 7.999999999999999e-17, 1.8000000000000002e-16
 # These were created using WolframAlpha. NOTE lambda parameter is 1/mean
 sf.hp.points = 183, 197
 sf.hp.values = 1.2729811194234181e-16, 7.741006159285781e-18
+
+# Overridden tolerances
+sf.hp.relative = 8e-15
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.f.6.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.f.6.properties
index 985c5bb..38d1a8c 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.f.6.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.f.6.properties
@@ -14,8 +14,6 @@
 # limitations under the License.
 
 parameters = 100.0 100.0
-# Limited by pdf values
-tolerance.relative = 2e-14
 
 # Computed using scipy.stats f
 mean = 1.0204081632653061
@@ -150,3 +148,9 @@ sf.values = \
   3.291738902473012191522577e-13 \
   5.633510994394574646201736e-14 \
   1.016526891539289621285067e-14
+
+# Overridden tolerances
+cdf.relative = 2e-14
+pdf.relative = 2e-14
+logpdf.relative = 2e-14
+sf.relative = 2e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.geometric.4.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.geometric.4.properties
new file mode 100644
index 0000000..759e9c6
--- /dev/null
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.geometric.4.properties
@@ -0,0 +1,59 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+parameters = 0.75
+mean = 0.333333333333333333333
+variance = 0.4444444444444444444
+lower = 0
+# Reference values are from R, version 3.4.4 dgeom
+cdf.points = -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
+cdf.values = \
+   0.00000000000000000 0.75000000000000000 0.93750000000000000 \
+   0.98437500000000000 0.99609375000000000 0.99902343750000000 \
+   0.99975585937500000 0.99993896484375000 0.99998474121093750 \
+   0.99999618530273438 0.99999904632568359 0.99999976158142090 \
+   0.99999994039535522 0.99999998509883881 0.99999999627470970 \
+   0.99999999906867743 0.99999999976716936 0.99999999994179234 \
+   0.99999999998544808 0.99999999999636202
+pmf.values = \
+   0.0000000000000000e+00 7.5000000000000000e-01 1.8750000000000000e-01 \
+   4.6875000000000000e-02 1.1718750000000005e-02 2.9296875000000009e-03 \
+   7.3242187500000000e-04 1.8310546875000011e-04 4.5776367187500020e-05 \
+   1.1444091796875005e-05 2.8610229492187508e-06 7.1525573730468750e-07 \
+   1.7881393432617185e-07 4.4703483581543035e-08 1.1175870895385757e-08 \
+   2.7939677238464389e-09 6.9849193096160951e-10 1.7462298274040233e-10 \
+   4.3655745685100581e-11 1.0913936421275144e-11
+logpmf.values = \
+                   -Inf  -0.2876820724517809  -1.6739764335716716 \
+    -3.0602707946915619  -4.4465651558114523  -5.8328595169313431 \
+    -7.2191538780512339  -8.6054482391711247  -9.9917426002910155 \
+   -11.3780369614109063 -12.7643313225307971 -14.1506256836506878 \
+   -15.5369200447705786 -16.9232144058904659 -18.3095087670103567 \
+   -19.6958031281302475 -21.0820974892501383 -22.4683918503700291 \
+   -23.8546862114899199 -25.2409805726098107
+sf.values = \
+   1.0000000000000000e+00 2.5000000000000000e-01 6.2500000000000000e-02 \
+   1.5625000000000007e-02 3.9062500000000009e-03 9.7656250000000000e-04 \
+   2.4414062500000016e-04 6.1035156250000027e-05 1.5258789062500007e-05 \
+   3.8146972656250008e-06 9.5367431640625000e-07 2.3841857910156247e-07 \
+   5.9604644775390718e-08 1.4901161193847676e-08 3.7252902984619182e-09 \
+   9.3132257461547934e-10 2.3283064365386978e-10 5.8207660913467446e-11 \
+   1.4551915228366858e-11 3.6379788070917138e-12
+
+sf.hp.points = 74, 81
+sf.hp.values = 7.0064923216241180e-46 4.2764235361475425e-50
+
+# Overridden tolerances
+pmf.relative = 2e-15
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.laplace.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.laplace.1.properties
index f288fa6..672bea7 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.laplace.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.laplace.1.properties
@@ -32,9 +32,19 @@ pdf.values = \
   0.18393972058572117  , 0.06766764161830635  ,\
   0.024893534183931972 , 0.00915781944436709  ,\
   0.0033689734995427335
+sf.values = \
+  0.9966310265004573   , 0.9908421805556329   ,\
+  0.9751064658160681   , 0.9323323583816936   ,\
+  0.8160602794142788   , 0.5                  ,\
+  0.18393972058572117  , 0.0676676416183064   ,\
+  0.02489353418393192  , 0.00915781944436711  ,\
+  0.0033689734995426823
+
 # Computed using WolframAlpha
 cdf.hp.points = -42, -43
 cdf.hp.values = 2.87476113214678e-19, 1.0575655187955402e-19
 sf.hp.points = 42, 43
 sf.hp.values = 2.87476113214678e-19, 1.0575655187955402e-19
 
+# Overridden tolerances
+sf.relative = 2e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.levy.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.levy.1.properties
index 2f7d37c..cdf4651 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.levy.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.levy.1.properties
@@ -47,7 +47,6 @@ logpdf.values = \
 # Computed using WolframAlpha
 cdf.hp.points = 1.205, 1.2049
 cdf.hp.values = 3.7440973842063723e-19, 1.6388396909072308e-19
-cdf.hp.relative = 5e-14
 sf.hp.points = 1e39, 42e37
 sf.hp.values = 1.5957691216057308e-20, 2.4623252122982907e-20
 # As cdf.values above but with the redundant 0 removed
@@ -58,3 +57,6 @@ icdf.points = \
   4.4969179796889102718e-01, 6.6981535759941657204e-01,\
   7.6302460055299503594e-01
 icdf.values = 1.2, 1.21, 1.225, 1.25, 1.3, 1.9, 3.4, 5.6
+
+# Overridden tolerances
+cdf.hp.relative = 5e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.lognormal.3.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.lognormal.3.properties
index dfd01cb..273882b 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.lognormal.3.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.lognormal.3.properties
@@ -16,7 +16,6 @@
 parameters = 1.0 0.75
 # Computed using scipy.stats lognorm
 # Tolerance lowered for CDF inverse mapping test
-tolerance.absolute = 1e-7
 mean = 3.601138336272175
 variance = 9.791697776557593
 lower = 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties
index cdf1651..88889af 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties
@@ -64,8 +64,6 @@ sf.values = \
 # scipy:                       2.7412226346110703e-18  4.1045652533918685e-19
 cdf.hp.points = -10, -10.3
 cdf.hp.values = 2.74122263461107252124815886312e-18, 4.10456525339188007632261800065e-19
-cdf.hp.relative = 1e-14
-cdf.hp.mapping.relative = 5e-14
 
 # E.g.
 # x = sym(14.5)
@@ -78,5 +76,9 @@ cdf.hp.mapping.relative = 5e-14
 # scipy:                       4.1045652533918685e-19  1.7495528006975224e-17
 sf.hp.points = 14.5, 13.9
 sf.hp.values = 4.10456525339190342717686865166e-19, 1.74955280069751640746342569694e-17
+
+# Overridden tolerances
+cdf.hp.relative = 1e-14
+cdf.hp.mapping.relative = 5e-14
 sf.hp.relative = 1e-14
 sf.hp.mapping.relative = 5e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pascal.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pascal.1.properties
index 2bbe846..08de838 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pascal.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pascal.1.properties
@@ -17,7 +17,7 @@ parameters = 10 0.7
 mean = 4.285714285714286
 variance = 6.122448979591837
 lower = 0
-# Computed using R version 3.4.4
+# Computed using R version 3.4.4 pnbinom(10, 0.7)
 cdf.points = -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
 cdf.values = \
   0.00000000000000000000 0.02824752489999998728 0.11299009959999994912 \
@@ -33,6 +33,12 @@ pmf.values = \
   0.0706732734780072674452 0.0450542118422295745361 \
   0.0270325271053377391706 0.0154085404500425206947 \
   0.0084046584272959232176
+sf.values = \
+   1.0000000000000000000 0.9717524750999999572 0.8870099004000000509 \
+   0.7471846521450000722 0.5793943542390000978 0.4157988137806499784 \
+   0.2783785597956361380 0.1753133693068757160 0.1046400958288684485 \
+   0.0595858839866388185 0.0325533568813010446 0.0171448164312584528 \
+   0.0087401580039625278
 icdf.points = \
   0.0, 0.001, 0.010, 0.025, 0.050, 0.100, 0.999,\
   0.990, 0.975, 0.950, 0.900, 1.0
@@ -43,5 +49,8 @@ isf.points = \
   0.001, 0.010, 0.025, 0.050, 0.100, 0
 isf.values = \
   0, 0, 0, 0, 1, 1, 14, 11, 10, 9, 8, 2147483647
-sf.points = 47, 52
-sf.values = 3.1403888119656772712e-17, 1.7075879020163069251e-19
+sf.hp.points = 47, 52
+sf.hp.values = 3.1403888119656772712e-17, 1.7075879020163069251e-19
+
+# Overridden tolerances
+sf.hp.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.3.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.3.properties
index 42f1c4a..d124d5f 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.3.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.3.properties
@@ -14,8 +14,6 @@
 # limitations under the License.
 
 parameters = 10.0
-tolerance.relative = 5e-14
-tolerance.relative.hp = 5e-14
 mean = 10
 variance = 10
 lower = 0
@@ -59,3 +57,7 @@ logpmf.values = \
   -6.28391460087256348288
 sf.hp.points = 55 60
 sf.hp.values = 7.73802024585487637209e-24,   1.06582832765798891240e-27
+
+# Overridden tolerances
+sf.relative = 5e-14
+sf.hp.relative = 5e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.1.properties
index dd00c9a..2536a70 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.1.properties
@@ -14,8 +14,6 @@
 # limitations under the License.
 
 parameters = 5.0
-# Limited by SF
-tolerance.relative = 2e-15
 # Computed using R version 2.9.2
 mean = 0.0
 variance = 1.666666666666667
@@ -46,3 +44,8 @@ cdf.hp.points = -4200, -6400
 cdf.hp.values = 7.261513520181652e-18, 8.838404680725267e-19
 sf.hp.points = 4200, 6400
 sf.hp.values =7.261513520181652e-18, 8.838404680725267e-19
+
+# Overridden tolerances
+cdf.relative = 2e-15
+pdf.relative = 2e-15
+sf.relative = 2e-15
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.10.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.10.properties
index a16cb02..502f0fd 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.10.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.10.properties
@@ -14,8 +14,6 @@
 # limitations under the License.
 
 parameters = 1e14
-# Limited by density values
-tolerance.relative = 2e-15
 mean = 0
 variance = 1.00000000000002
 # computed using R
@@ -43,3 +41,7 @@ sf.values = \
   1.5865525393145837874e-01 2.2750131948180554731e-02 \
   1.3498980316304252589e-03 3.1671241833142672244e-05 \
   2.8665157187967719709e-07
+
+# Overridden tolerances
+pdf.relative = 2e-15
+sf.relative = 2e-15
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.4.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.4.properties
index b120527..871d6e1 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.4.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.4.properties
@@ -15,8 +15,6 @@
 
 # Special case for large degrees of freedom is the standard normal distribution
 parameters = Infinity
-# Limited by inverse mapping test
-tolerance.relative = 2e-15
 mean = 0
 variance = 1
 # normcdf/normpdf/normpdf('upper') computed using matlab
@@ -49,3 +47,7 @@ sf.values = \
   0.0013498980316300957 \
   3.1671241833119965e-05 \
   2.866515718791946e-07
+
+# Overridden tolerances
+cdf.mapping.relative = 2e-15
+sf.mapping.relative = 2e-15
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.5.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.5.properties
index 0945346..67c1669 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.5.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.5.properties
@@ -14,8 +14,6 @@
 # limitations under the License.
 
 parameters = 10.0
-# Limited by SF inverse mapping
-tolerance.relative = 2e-15
 mean = 0
 variance = 1.25
 # computed using R
@@ -41,3 +39,8 @@ sf.values = \
   0.17044656615103004337897 0.03669401738537019647124 \
   0.00667182751128479398228 0.00125916631236834509686 \
   0.00026866680137822623528
+
+# Overridden tolerances
+sf.relative = 2e-15
+cdf.mapping.relative = 2e-15
+sf.mapping.relative = 2e-15
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.6.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.6.properties
index 22e0aee..5bb23cf 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.6.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.6.properties
@@ -14,8 +14,6 @@
 # limitations under the License.
 
 parameters = 100.0
-# Limited by SF values
-tolerance.relative = 3e-15
 mean = 0
 variance = 1.0204081632653061
 # computed using R
@@ -43,3 +41,8 @@ sf.values = \
   1.5986207789206186014e-01 2.4106089365566834432e-02 \
   1.7039576716647252246e-03 6.0761822150380825143e-05 \
   1.2250867067518980009e-06
+
+# Overridden tolerances
+cdf.relative = 2e-15
+pdf.relative = 2e-15
+sf.relative = 3e-15
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.7.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.7.properties
index 9213c6e..136ba1a 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.7.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.7.properties
@@ -14,8 +14,6 @@
 # limitations under the License.
 
 parameters = 1e4
-# Limited by SF values
-tolerance.relative = 4e-15
 mean = 0
 variance = 1.0002000400080016
 # computed using R
@@ -43,3 +41,7 @@ sf.values = \
   1.5866735216521471452e-01 2.2763630330717734424e-02 \
   1.3532240949988326786e-03 3.1899334411569732234e-05 \
   2.9151633068313210561e-07
+
+# Overridden tolerances
+pdf.relative = 2e-15
+sf.relative = 4e-15
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.8.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.8.properties
index 2e212f6..5d24636 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.8.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.8.properties
@@ -14,8 +14,6 @@
 # limitations under the License.
 
 parameters = 1e6
-# Limited by SF values
-tolerance.relative = 4e-15
 mean = 0
 variance = 1.000002000004
 # computed using R
@@ -43,3 +41,7 @@ sf.values = \
   1.5865537491678907700e-01 2.2750266925659592271e-02 \
   1.3499312707108961518e-03 3.1673517005023936119e-05 \
   2.8669989354453675792e-07
+
+# Overridden tolerances
+pdf.relative = 2e-15
+sf.relative = 4e-15
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.9.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.9.properties
index 55c49aa..53ef00a 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.9.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.9.properties
@@ -14,8 +14,6 @@
 # limitations under the License.
 
 parameters = 1e10
-# Limited by SF values
-tolerance.relative = 4e-15
 mean = 0
 variance = 1.0000000002
 # computed using R
@@ -43,3 +41,8 @@ sf.values = \
   1.5865525394355539657e-01 2.2750131961676897663e-02 \
   1.3498980349539761118e-03 3.1671242060631252789e-05 \
   2.8665157671103194958e-07
+
+# Overridden tolerances
+cdf.relative = 3e-15
+logpdf.relative = 2e-15
+sf.relative = 4e-15
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.11.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.11.properties
index bcfa2d2..d96bc00 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.11.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.11.properties
@@ -16,13 +16,6 @@
 # As per uniform distribution (-0.5, 1.25)
 # From [test.uniformcontinuous.1.properties]
 parameters = -0.5 -0.5 1.25 1.25
-# Lower tolerance to pass survival function test.
-# scipy uniform does not appear to compute sf to high precision.
-tolerance.relative = 1e-14
-# probability(x0, x1) test expects this to be cdf(x1) - cdf(x0).
-# The computation is 0.5 ulp exact using (x1 - x0) / (upper - lower).
-# Configure the absolute error to allow this.
-tolerance.absolute = 5e-17
 
 # Computed using scipy.stats uniform(-0.5, 1.75)
 mean = 0.375
@@ -53,3 +46,13 @@ sf.values = \
   7.142285714285714e-01, 5.714285714285714e-01,\
   1.428571428571429e-01, 5.7142857142850847e-05,\
   0.000000000000000e+00, 0.000000000000000e+00
+
+# Overridden tolerances
+
+# probability(x0, x1) test expects this to be cdf(x1) - cdf(x0).
+# The computation is 0.5 ulp exact using (x1 - x0) / (upper - lower).
+# Configure the absolute error to allow this.
+consistency.absolute = 5e-17
+# Lower tolerance to pass survival function test.
+# scipy uniform does not appear to compute sf to high precision.
+sf.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.12.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.12.properties
index 815c70d..f31f8c3 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.12.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.12.properties
@@ -16,9 +16,6 @@
 # As per uniform distribution (-4.6, 12.2)
 # From [test.uniformcontinuous.2.properties]
 parameters = -4.6 -4.6 12.2 12.2
-# Lower tolerance to pass survival function test.
-# scipy uniform does not appear to compute sf to high precision.
-tolerance.relative = 1e-14
 # Computed using scipy.stats uniform(-4.6, 16.8)
 mean = 3.8
 variance = 23.52
@@ -50,3 +47,7 @@ cdf.hp.values = 5.2867763077388404e-17
 # (12.2 - Math.nextDown(12.2)) / (12.2 - -4.6)
 sf.hp.points = 12.199999999999998
 sf.hp.values = 1.0573552615477683E-16
+
+# Overridden tolerances
+# scipy uniform does not appear to compute sf to high precision.
+sf.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.3.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.3.properties
index 6281740..3c01082 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.3.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.3.properties
@@ -16,8 +16,6 @@
 # computed using R 3.4.4: require(trapezoid)
 # dtrapezoid(x, min=2, mode1=2, mode2=4, max=6)
 parameters = 2.0 2.0 4.0 6.0
-# Limited by SF
-tolerance.relative = 8e-15
 
 # Computed manually using scipy.stats trapezoid
 mean = 3.5555555555555554
@@ -51,3 +49,6 @@ pdf.values = \
   0.291666666666666629659 0.250000000000000000000 0.208333333333333314830 \
   0.166666666666666657415 0.125000000000000000000 0.083333333333333328707 \
   0.041666666666666664354 0.000000000000000000000
+
+# Overridden tolerances
+sf.relative = 8e-15
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.7.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.7.properties
index 36c25a6..9b459a9 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.7.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.7.properties
@@ -16,8 +16,6 @@
 # As per triangular distribution (-3, 2, 12)
 # From [test.triangular.1.properties]
 parameters = -3.0, 2.0, 2.0, 12.0
-# Limited by SF
-tolerance.relative = 6e-14
 
 mean = 3.6666666666666665
 variance = 9.722222222222221
@@ -42,3 +40,7 @@ pdf.values = \
   0.13333333333333333,\
   0.12, 0.10666666666666667, 0.02666666666666667, 0.013333333333333334,\
   0,
+
+# Overridden tolerances
+cdf.relative = 4e-14
+sf.relative = 6e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.8.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.8.properties
index 50a08ef..19635b9 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.8.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.trapezoidal.8.properties
@@ -16,8 +16,6 @@
 # As per triangular distribution (1, 2, 5)
 # From [test.triangular.2.properties]
 parameters = 1.0 2.0 2.0 5.0
-# Limited by SF
-tolerance.relative = 1e-14
 
 mean = 2.6666666666666667
 variance = 0.722222222222222
@@ -42,3 +40,6 @@ pdf.values = \
   0.2916666666666667  , 0.25                , 0.20833333333333334 , \
   0.16666666666666666 , 0.125               , 0.08333333333333333 , \
   0.041666666666666664, 0.
+
+# Overridden tolerances
+sf.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.triangular.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.triangular.1.properties
index 64d5da8..9ea71d2 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.triangular.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.triangular.1.properties
@@ -70,3 +70,7 @@ pdf.values = \
   0.13333333333333333,\
   0.12, 0.10666666666666667, 0.02666666666666667, 0.013333333333333334,\
   0,
+
+# Overridden tolerances
+cdf.relative = 4e-14
+sf.relative = 6e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.triangular.2.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.triangular.2.properties
index af6570a..757431c 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.triangular.2.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.triangular.2.properties
@@ -39,3 +39,6 @@ pdf.values = \
   0.2916666666666667  , 0.25                , 0.20833333333333334 , \
   0.16666666666666666 , 0.125               , 0.08333333333333333 , \
   0.041666666666666664, 0.
+
+# Overridden tolerances
+sf.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.1.properties
index fde65c6..f4fb5d4 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.1.properties
@@ -14,10 +14,6 @@
 # limitations under the License.
 
 parameters = 1.9, 1.3, -1.1, 3.4
-# Limited by survival function values.
-# SciPy computes (sf(x) - sf(b)) / (sf(a) - sf(b).
-# TruncatedNormal computes using the range: probability(x, b) / probability(a, b)
-tolerance.relative = 2e-12
 mean = 1.6337579236572282
 variance = 1.0315870391443911
 lower = -1.1
@@ -50,3 +46,19 @@ pdf.values = \
   0.3259775225028439  , 0.2568050224891308  , 0.22288611580650672 ,\
   0.20349491508705372 , 0.1909979466669913  , 0.18316791888523876 ,\
   0.18237070654220913 , 0.18228196537391378
+sf.values = \
+  1.0000000000000000e+00, 9.9990000000000001e-01, \
+  9.9899999999999989e-01, 9.8999999999999988e-01, \
+  9.7499999999999998e-01, 9.4999999999999996e-01, \
+  8.9999999999999991e-01, 7.5000000000000011e-01, \
+  4.9999999999999878e-01, 2.4999999999999931e-01, \
+  1.0000000000000085e-01, 4.9999999999999142e-02, \
+  2.4999999999999634e-02, 9.9999999999996619e-03, \
+  1.0000000000008195e-03, 9.9999999999716242e-05, \
+  0.0000000000000000e+00 \
+
+# Overridden tolerances
+# Limited by survival function values.
+# SciPy computes (sf(x) - sf(b)) / (sf(a) - sf(b).
+# TruncatedNormal computes using the range: probability(x, b) / probability(a, b)
+sf.relative = 2e-12
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.2.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.2.properties
index 2a21c2d..c3dded3 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.2.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.2.properties
@@ -36,3 +36,7 @@ pdf.values = \
   0.07052739999811058  , 0.18675202746331704  ,\
   0.44218230973931666  , 0.9361942928302114   ,\
   1.0042381761830197
+
+# Overridden tolerances
+logpdf.relative = 2e-13
+moments.relative = 1e-13
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.3.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.3.properties
index 9506cfd..4dd42d6 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.3.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.3.properties
@@ -36,3 +36,6 @@ pdf.values = \
   5.8186505170566153e-03, 1.3010903661149294e-03,\
   1.8768518629755845e-04, 1.7465856071542793e-05,\
   0.0000000000000000e+00
+
+# Overridden tolerances
+sf.relative = 1e-13
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.4.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.4.properties
index dc1077f..6ea4bc7 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.4.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.4.properties
@@ -15,8 +15,6 @@
 
 # Test no truncation
 parameters = 3.0, 1.1, -Infinity, Infinity
-# Limited by the CDF inverse mapping test
-tolerance.relative = 1e-9
 mean = 3
 variance = 1.21
 lower = -Infinity
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.5.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.5.properties
index dbd39a1..7ac093c 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.5.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.5.properties
@@ -15,8 +15,6 @@
 
 # Test a truncation range that is completely below the mean.
 parameters = 0.0, 1.0, -Infinity, -5.0
-# Limited by the SF inverse mapping test
-tolerance.relative = 2e-8
 mean = -5.18650396712584211561650896200523673
 variance = 0.0326964346171122253453158077009336653
 lower = -Infinity
@@ -37,3 +35,13 @@ pdf.values = \
   0.                 , 0.01225629220519301, 0.03627051385554845,\
   0.10388394392826272, 0.28796736254445054, 0.7725706891274351 ,\
   2.006010974330893  , 5.041137007541032  , 5.186503967125854
+sf.values =  \
+  1.                 , 0.9980380355514441 , 0.9940250852662816 , \
+  0.9823752797552957 , 0.9496404359712429 , 0.8606099542475493 , \
+  0.6262388168228976 , 0.02905695902309169, 0.
+
+# Overridden tolerances
+moments.relative = 1e-13
+logpdf.relative = 1e-13
+sf.relative = 1e-8
+sf.mapping.relative = 2e-8
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.6.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.6.properties
index 964fcfc..d5a5d93 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.6.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.6.properties
@@ -15,8 +15,6 @@
 
 # Test a truncation range that is completely above the mean.
 parameters = 0.0, 1.0, 5.0, Infinity
-# Limited by the CDF inverse mapping test
-tolerance.relative = 6e-9
 mean = 5.18650396712584211561650896200523673
 variance = 0.0326964346171122253453158077009336653
 lower = 5
@@ -35,3 +33,10 @@ pdf.values = \
   5.186503967125854   , 5.041137006347447   , 2.006010972720016   ,\
   0.7725706879510773  , 0.2879673607116971  , 0.10388394357314994 ,\
   0.03627051296078461 , 0.012256291809202381, 0.
+
+# Overridden tolerances
+moments.relative = 1e-13
+cdf.relative = 1e-12
+cdf.mapping.relative = 6e-9
+sf.relative = 1e-13
+logpdf.relative = 1e-13
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.7.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.7.properties
index 33269ea..5aa7dfc 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.7.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.7.properties
@@ -22,12 +22,6 @@
 
 parameters = 7.1, 9.9, 7.0999999, 7.1000001
 
-# Limited by the computation of variance (which -> 0). Solved with absolute tolerance.
-# Also note that the relative error is lowered to pass the tests for logpdf, cdf and sf.
-
-tolerance.relative = 5e-9
-tolerance.absolute = 1e-14
-
 # scipy computes mean = 7.0999999999999996, var = 1.1358413484763297e-07 (too high)
 
 # Computed using 128-bit quad precision test c++ program using Boost erf for the
@@ -52,3 +46,11 @@ cdf.points = 7.0999999, 7.1, 7.1000001
 cdf.values = 0, 0.5, 1
 pdf.values = 5000000.00238838, 5000000.00238838, 5000000.00238838
 logpdf.values = 15.42494847087604981084, 15.42494847087604981084, 15.42494847087604981084
+
+# Overridden tolerances
+# Limited by the computation of variance (which -> 0). Solved with absolute tolerance.
+moments.absolute = 1e-14
+cdf.relative = 5e-9
+sf.relative = 5e-9
+pdf.relative = 5e-9
+logpdf.relative = 1e-10
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.8.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.8.properties
index 2258149..3b8d46e 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.8.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.truncatednormal.8.properties
@@ -49,3 +49,6 @@ pdf.values = \
   0.1114285040919437697 ,  0.08634778616397101314,\
   0.06624653531224142244,  0.05031902148341711734,\
   0.03784062141893289322,  0.02817353793573459941,  0.
+
+# Overridden tolerances
+sf.relative = 4e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformcontinuous.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformcontinuous.1.properties
index aee6b1e..a1b1a34 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformcontinuous.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformcontinuous.1.properties
@@ -14,14 +14,6 @@
 # limitations under the License.
 
 parameters = -0.5 1.25
-# Lower tolerance to pass survival function test.
-# scipy uniform does not appear to compute sf to high precision.
-tolerance.relative = 1e-14
-# probability(x0, x1) test expects this to be cdf(x1) - cdf(x0).
-# The computation is 0.5 ulp exact using (x1 - x0) / (upper - lower).
-# Configure the absolute error to allow this.
-tolerance.absolute = 5e-17
-
 # Computed using scipy.stats uniform(-0.5, 1.75)
 mean = 0.375
 variance = 0.2552083333333333
@@ -51,3 +43,13 @@ sf.values = \
   7.142285714285714e-01, 5.714285714285714e-01,\
   1.428571428571429e-01, 5.7142857142850847e-05,\
   0.000000000000000e+00, 0.000000000000000e+00
+
+# Overridden tolerances
+
+# probability(x0, x1) test expects this to be cdf(x1) - cdf(x0).
+# The computation is 0.5 ulp exact using (x1 - x0) / (upper - lower).
+# Configure the absolute error to allow this.
+consistency.absolute = 5e-17
+# Lower tolerance to pass survival function test.
+# scipy uniform does not appear to compute sf to high precision.
+sf.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformcontinuous.2.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformcontinuous.2.properties
index de845be..68612b8 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformcontinuous.2.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformcontinuous.2.properties
@@ -14,9 +14,6 @@
 # limitations under the License.
 
 parameters = -4.6 12.2
-# Lower tolerance to pass survival function test.
-# scipy uniform does not appear to compute sf to high precision.
-tolerance.relative = 1e-14
 # Computed using scipy.stats uniform(-4.6, 16.8)
 mean = 3.8
 variance = 23.52
@@ -48,3 +45,14 @@ cdf.hp.values = 5.2867763077388404e-17
 # (12.2 - Math.nextDown(12.2)) / (12.2 - -4.6)
 sf.hp.points = 12.199999999999998
 sf.hp.values = 1.0573552615477683E-16
+
+# Overridden tolerances
+
+# probability(x0, x1) test expects this to be cdf(x1) - cdf(x0).
+# The computation is 0.5 ulp exact using (x1 - x0) / (upper - lower).
+# Configure the absolute error to allow this.
+consistency.absolute = 5e-15
+
+# Lower tolerance to pass survival function test.
+# scipy uniform does not appear to compute sf to high precision.
+sf.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformdiscrete.3.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformdiscrete.3.properties
index 73a2499..a217f67 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformdiscrete.3.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.uniformdiscrete.3.properties
@@ -16,15 +16,6 @@
 # Big range that will overflow an integer
 parameters = -1234682638, 1825371824
 
-# Limited by probability(-123, 13).
-# The computation is:
-# (13 - -123) / (1825371824L + 1234682638 + 1) = 136 / 3060054463 = 4.4443653420033914E-8
-# The test expects this to be cdf(13) - cdf(-123):
-# 0.40348388139129665 - 0.4034838369476432 = 4.444365342415324E-8
-# The difference is: rel.error: <9.268649280418735E-11>, abs.error: <4.119326363289576E-18>
-# Configure the absolute error to allow this.
-tolerance.absolute = 5e-18
-
 # Computed using Wolfram Mathematica
 mean = 295344593
 variance = 780327776377184864
@@ -50,3 +41,10 @@ sf.values = \
   0.59651616305235675800, 0.59651611860870333797, \
   0.59649756926564872058, 0.49905447744967145704, \
   3.2679156926495526887e-10, 0
+
+# Overridden tolerances
+# Limited by probability(x0, x1).
+# The test expects this to be cdf(x1) - cdf(x0) but the distribution computation is
+# more accurate. Configure the test tolerance to allow small differences.
+consistency.relative = 4e-13
+consistency.absolute = 5e-18
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.1.properties
index f1cf0f4..bdb9bc1 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.1.properties
@@ -18,21 +18,32 @@ parameters = 1.2 2.1
 mean = 1.975377302339221
 variance = 2.7330624165923862
 lower = 0
-tolerance.absolute = 1e-10
-# Computed using R 2.9.2
+# Computed using R 3.4.4
+# print(qweibull(c(0, 0.001, 0.01, 0.025, 0.05, 0.1, 0.999, 0.990, 0.975, 0.950, 0.900, 1), 1.2, 2.1), digits=17)
 cdf.points = \
-  0, 0.00664355180993, 0.0454328283309, 0.0981162737374, 0.176713524579, 0.321946865392,\
-  10.5115496887, 7.4976304671, 6.23205600701, 5.23968436955, 4.2079028257, Inf
+   0.0000000000000000000  0.0066435518099300104  0.0454328283308579328                                                             \
+   0.0981162737373693222  0.1767135245790810993  0.3219468653921029877                                                             \
+  10.5115496887108204049  7.4976304670939954988  6.2320560070089916493                                                             \
+   5.2396843695505692651  4.2079028257805450863                    Inf
+# Points computed using qweibull(
+# 0, 0.001, 0.01, 0.025, 0.05, 0.1, 0.999, 0.990, 0.975, 0.950, 0.900, 1
 cdf.values = \
-  0, 0.001, 0.01, 0.025, 0.05, 0.1, 0.999,\
-  0.990, 0.975, 0.950, 0.900, 1
+  0.000000000000000000 0.001000000000000000 0.010000000000000000 \
+  0.025000000000000001 0.049999999999999996 0.100000000000000006 \
+  0.998999999999999999 0.989999999999999991 0.974999999999999978 \
+  0.949999999999999956 0.900000000000000022 1.000000000000000000
 pdf.values = \
-  0, 0.180535929306, 0.262801138133, 0.301905425199, 0.330899152971,\
-  0.353441418887, 0.000788590320203, 0.00737060094841, 0.0177576041516, 0.0343043442574, 0.065664589369, 0
+  0.00000000000000000000 0.18053592930625095292 0.26280113813319894156 \
+  0.30190542519897145546 0.33089915297139427253 0.35344141888714142308 \
+  0.00078859032019618536 0.00737060094844553624 0.01775760415165640940 \
+  0.03430434425741124560 0.06566458936894088716 0.00000000000000000000
+sf.values = \
+  1.000000000000000000 0.998999999999999999 0.989999999999999991 \
+  0.974999999999999978 0.949999999999999956 0.900000000000000022 \
+  0.001000000000000002 0.010000000000000014 0.025000000000000012 \
+  0.050000000000000051 0.099999999999999978 0.000000000000000000
 # Computed using WolframAlpha
 cdf.hp.points = 1e-14, 1e-15
 cdf.hp.values = 6.506341377907031e-18, 4.1052238780858223e-19
-cdf.hp.absolute = 0
 sf.hp.points = 45, 47.2
 sf.hp.values = 6.6352694710268576e-18, 6.444810903667567e-19
-sf.hp.absolute = 0
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.6.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.6.properties
index c6893d0..a924c13 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.6.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.weibull.6.properties
@@ -14,12 +14,10 @@
 # limitations under the License.
 
 parameters = 3.0 2.0
-# Computed using scipy.stats weibull_min
+# Computed using scipy.stats weibull_min(3, 0, 2)
 mean = 1.7859590231384979
 variance = 0.42133153947391655
 lower = 0
-# Limited by the CDF inverse
-tolerance.absolute = 1e-11
 cdf.points = \
   0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.1, 0.25, 0.5, 0.75, \
   1.0, 1.25, 1.5, 1.75, \
@@ -27,32 +25,32 @@ cdf.points = \
   3.0, 3.25, 3.5, 3.75, \
   4.0, 4.25, 4.5, 4.75, 5.0
 cdf.values = \
-  0.00000000000000000000e+00,   1.24999992187500343198e-07,\
-  9.99999500000166912316e-07,   3.37499430469390671841e-06,\
-  7.99996800008533393597e-06,   1.56248779303232831334e-05,\
-  1.24992187825510690661e-04,   1.95121889252452738149e-03,\
-  1.55035629945915933575e-02,   5.13680406166697883785e-02,\
-  1.17503097415404600401e-01,   2.16622535939181792841e-01,\
-  3.44183988728498424514e-01,   4.88251443419166653026e-01,\
-  6.32120558828557665976e-01,   7.59209525727751466384e-01,\
-  8.58169840912657466703e-01,   9.25697403001813912127e-01,\
-  9.65781881688334009617e-01,   9.86308986701507461881e-01,\
-  9.95296154907762464781e-01,   9.98628426797543933269e-01,\
-  9.99664537372097483647e-01,   9.99931979615455657218e-01,\
-  9.99988699063956820723e-01,   9.99998479519835004048e-01,\
-  9.99999836262286945221e-01
+  0.0000000000000000e+00 1.2499999218750034e-07 9.9999950000016670e-07 \
+  3.3749943046939067e-06 7.9999680000853339e-06 1.5624877930323287e-05 \
+  1.2499218782551069e-04 1.9512188925245274e-03 1.5503562994591595e-02 \
+  5.1368040616669788e-02 1.1750309741540460e-01 2.1662253593918182e-01 \
+  3.4418398872849848e-01 4.8825144341916660e-01 6.3212055882855767e-01 \
+  7.5920952572775147e-01 8.5816984091265747e-01 9.2569740300181391e-01 \
+  9.6578188168833401e-01 9.8630898670150746e-01 9.9529615490776246e-01 \
+  9.9862842679754393e-01 9.9966453737209748e-01 9.9993197961545566e-01 \
+  9.9998869906395682e-01 9.9999847951983500e-01 9.9999983626228695e-01
 pdf.values = \
-  0.00000000000000000000e+00,   3.74999953125003000483e-05,\
-  1.49999850000075016709e-04,   3.37498860939422170614e-04,\
-  5.99995200019200073185e-04,   9.37485351676940552833e-04,\
-  3.74953127929565513746e-03,   2.33917683072064584715e-02,\
-  9.22965409692570459832e-02,   2.00102053932421225513e-01,\
-  3.30936338469223323422e-01,   4.59010232848135690809e-01,\
-  5.53344759510329464725e-01,   5.87711232948300854595e-01,\
-  5.51819161757163501036e-01,   4.57125666001221897528e-01,\
-  3.32414435360959048538e-01,   2.10717521174543370721e-01,\
-  1.15486149301872856321e-01,   5.42292479869979568430e-02,\
-  2.16082883924662537412e-02,   7.23290555982671577728e-03,\
-  2.01277576741507122776e-03,   4.60731823437120549796e-04,\
-  8.58164830776422663580e-05,   1.28646876456050583080e-05,\
-  1.53504105992888691891e-06
+  0.0000000000000000e+00 3.7499995312500300e-05 1.4999985000007502e-04 \
+  3.3749886093942217e-04 5.9999520001920007e-04 9.3748535167694055e-04 \
+  3.7495312792956551e-03 2.3391768307206458e-02 9.2296540969257046e-02 \
+  2.0010205393242123e-01 3.3093633846922332e-01 4.5901023284813569e-01 \
+  5.5334475951032946e-01 5.8771123294830085e-01 5.5181916175716350e-01 \
+  4.5712566600122190e-01 3.3241443536095905e-01 2.1071752117454337e-01 \
+  1.1548614930187286e-01 5.4229247986997957e-02 2.1608288392466254e-02 \
+  7.2329055598267158e-03 2.0127757674150712e-03 4.6073182343712055e-04 \
+  8.5816483077642266e-05 1.2864687645605058e-05 1.5350410599288869e-06
+sf.values = \
+  1.0000000000000000e+00 9.9999987500000787e-01 9.9999900000050002e-01 \
+  9.9999662500569531e-01 9.9999200003199995e-01 9.9998437512206972e-01 \
+  9.9987500781217453e-01 9.9804878110747552e-01 9.8449643700540845e-01 \
+  9.4863195938333023e-01 8.8249690258459546e-01 7.8337746406081821e-01 \
+  6.5581601127150158e-01 5.1174855658083340e-01 3.6787944117144233e-01 \
+  2.4079047427224856e-01 1.4183015908734253e-01 7.4302596998186088e-02 \
+  3.4218118311666032e-02 1.3691013298492581e-02 4.7038450922375517e-03 \
+  1.3715732024560290e-03 3.3546262790251185e-04 6.8020384544349979e-05 \
+  1.1300936043146307e-05 1.5204801649468582e-06 1.6373771305908126e-07 \
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.1.properties
index 73afbcc..9bde774 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.1.properties
@@ -14,8 +14,6 @@
 # limitations under the License.
 
 parameters = 10 1.0
-# Low precision test data
-tolerance.relative = 1e-10
 mean = 3.414171521474055
 variance = 7.121376190062840
 lower = 1
@@ -41,3 +39,9 @@ isf.points = \
   1, 0.999, 0.990, 0.975, 0.950, 0.6587, 0.6585, 0.001,\
   0.010, 0.025, 0.050, 0.100, 0
 isf.values = 1, 1, 1, 1, 1, 1, 2, 10, 10, 10, 9, 8, 10
+
+# Overridden tolerances
+# Low precision test data
+cdf.relative = 1e-11
+pmf.relative = 1e-11
+sf.relative = 1e-11
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.2.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.2.properties
index f7b8900..d5aba70 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.2.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.2.properties
@@ -38,3 +38,6 @@ pmf.values = \
   0.009828534179374833, 0.008794511623406259, 0.00792988505453027,\
   0.007198198301609725, 0.006572497032344038, 0.00603246794831849,\
   0.0055625429756955835, 0.005150611429735321
+
+# Overridden tolerances
+sf.relative = 5e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.3.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.3.properties
index 4211c59..265da1e 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.3.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.zipf.3.properties
@@ -19,7 +19,7 @@ variance = 3.5719600967876493
 lower = 1
 upper = 15
 cdf.points = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
-# Reference values from scipy.stats (1.7.1) zipfian
+# Reference values from scipy.stats (1.7.1) zipf(2.23, 15)
 cdf.values = \
   0.                , 0.6924674979902014, 0.8400729855406271,\
   0.8998341423916065, 0.931297539617085 , 0.9504267165563961,\
@@ -36,3 +36,12 @@ pmf.values = \
   0.004077550927314891 , 0.0032968083846534033,\
   0.0027153462395185157, 0.0022714632685367597,\
   0.0019254572222867578, 0.0016508814447150884
+sf.values =  \
+  1.                   , 0.3075325020097986   , \
+  0.15992701445937288  , 0.10016585760839346  , \
+  0.06870246038291498  , 0.049573283443604024 ,                                                                                  \
+  0.03683467156771332  , 0.027801697473517854 ,                                                                                  \
+  0.021094999901518467 , 0.01593750748702539  ,                                                                                  \
+  0.01185995655971061  , 0.008563148175057236 ,                                                                                  \
+  0.0058478019355387234, 0.003576338667001895 ,                                                                                  \
+  0.0016508814447150884, 0.


[commons-statistics] 01/04: Support per-test properties (tolerance, disable)

Posted by ah...@apache.org.
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 bf13f6969a26efe61d7fb2d5d7ea82a551d2d101
Author: aherbert <ah...@apache.org>
AuthorDate: Fri Nov 25 18:51:50 2022 +0000

    Support per-test properties (tolerance, disable)
    
    Use an enum to define the standard test names. This is the key in the
    test resource file used to look-up the test tolerance and disable flag.
---
 .../BaseContinuousDistributionTest.java            | 146 ++++-----
 .../distribution/BaseDiscreteDistributionTest.java | 171 ++++++-----
 .../distribution/BaseDistributionTest.java         | 327 +++------------------
 .../distribution/DistributionTestData.java         | 277 +++++++----------
 .../HypergeometricDistributionTest.java            |   4 +-
 .../distribution/NormalDistributionTest.java       |  10 -
 .../distribution/ParetoDistributionTest.java       |   4 +-
 .../distribution/PoissonDistributionTest.java      |   2 +-
 .../commons/statistics/distribution/TestName.java  |  82 ++++++
 .../distribution/test.binomial.2.properties        |   1 +
 .../distribution/test.binomial.3.properties        |   1 +
 .../statistics/distribution/test.levy.1.properties |   1 +
 .../distribution/test.normal.1.properties          |   2 +
 .../distribution/test.pareto.10.properties         |   2 +-
 .../distribution/test.pareto.11.properties         |   2 +-
 .../distribution/test.pareto.5.properties          |   2 +-
 .../distribution/test.pareto.6.properties          |   2 +-
 .../distribution/test.pareto.7.properties          |   2 +-
 .../distribution/test.pareto.9.properties          |   2 +-
 19 files changed, 399 insertions(+), 641 deletions(-)

diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
index 2510156..a9831d4 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseContinuousDistributionTest.java
@@ -89,13 +89,11 @@ import org.junit.jupiter.params.provider.MethodSource;
  * <li>Points for the PDF (and log PDF) can be specified. The default will use the CDF points.
  * Note: It is not expected that evaluation of the PDF will require different points to the CDF.
  * <li>Points and expected values for the inverse CDF can be specified. These are used in
- * addition to test the inverse mapping of the CDF values to the CDF test points. The
- * inverse mapping test can be disabled.
+ * addition to test the inverse mapping of the CDF values to the CDF test points.
  * <li>Expected values for the log PDF can be specified. The default will use
  * {@link Math#log(double)} on the PDF values.
  * <li>Points and expected values for the survival function can be specified. These are used in
- * addition to test the inverse mapping of the SF values to the SF test points. The
- * inverse mapping test can be disabled.
+ * addition to test the inverse mapping of the SF values to the SF test points.
  * The default will use the expected CDF values (SF = 1 - CDF).
  * <li>A tolerance for equality assertions. The default is set by {@link #getAbsoluteTolerance()}
  * and {@link #getRelativeTolerance()}.
@@ -103,9 +101,19 @@ import org.junit.jupiter.params.provider.MethodSource;
  *
  * <p>If the distribution provides higher precision implementations of
  * cumulative probability and/or survival probability as the values approach zero, then test
- * points and expected values can be provided with a tolerance for equality assertions of
- * high-precision computations. The default is set by {@link #getHighPrecisionAbsoluteTolerance()}
- * and {@link #getHighPrecisionRelativeTolerance()}.
+ * points and expected values can be provided for high-precision computations. If the default
+ * absolute tolerance has been set to non-zero, then very small p-values will require the
+ * high-precision absolute tolerance is configured for the test to a suitable magnitude (see below).
+ *
+ * <p>Per-test configuration
+ *
+ * <p>Each test is identified with a {@link TestName} key in the properties file. This key
+ * can be used to set a per-test tolerance, or disable the test:
+ * <pre>
+ * cdf.hp.relative = 1e-14
+ * cdf.hp.absolute = 1e-50
+ * sampling.disable
+ * </pre>
  *
  * <p>Note: All properties files are read during test initialization. Any errors in a single
  * property file will throw an exception, invalidating the initialization and no tests
@@ -138,7 +146,7 @@ import org.junit.jupiter.params.provider.MethodSource;
  *
  * <p>The properties file uses {@code key=value} pairs loaded using a
  * {@link java.util.Properties} object. Values will be read as String and then parsed to
- * numeric data, and data arrays. Multi-line values can use a {@code \} character.
+ * numeric data, and data arrays. Multi-line values can use a {@code \} character to join lines.
  * Data in the properties file will be converted to numbers using standard parsing
  * functions appropriate to the primitive type, e.g. {@link Double#parseDouble(String)}.
  * Special double values should use NaN, Infinity and -Infinity. As a convenience
@@ -159,10 +167,6 @@ import org.junit.jupiter.params.provider.MethodSource;
  * tolerance.relative = 1e-9
  * # optional (default 0.0 or over-ridden in getAbsoluteTolerance())
  * tolerance.absolute = 0.0
- * # optional (default 1e-12 or over-ridden in getHighPrecisionRelativeTolerance())
- * tolerance.relative.hp = 1e-10
- * # optional (default 0.0 or over-ridden in getHighPrecisionAbsoluteTolerance())
- * tolerance.absolute.hp = 1e-30
  * cdf.points = 0, 0.2
  * cdf.values = 0.0, 0.5
  * # optional (default uses cdf.points)
@@ -186,20 +190,10 @@ import org.junit.jupiter.params.provider.MethodSource;
  * # optional inverse CDF test (defaults to ignore)
  * isf.points = 1.0, 0.5
  * isf.values = 0.0, 0.2
- * # CDF inverse mapping test (default false)
- * disable.cdf.inverse = false
- * # SF inverse mapping test (default false)
- * disable.sf.inverse = false
- * # Sampling test (default false)
- * disable.sample = false
- * # PDF values test (default false)
- * disable.pdf = false
- * # Log PDF values test (default false)
- * disable.logpdf = false
- * # CDF values test (default false)
- * disable.cdf = false
- * # Survival function values test (default false)
- * disable.sf = false
+ * # Optional per-test tolerance and disable
+ * cdf.hp.relative = 1e-14
+ * cdf.hp.absolute = 1e-50
+ * sampling.disable = true
  * </pre>
  *
  * <p>See {@link NakagamiDistributionTest} for an example and the resource file {@code test.nakagami.1.properties}.
@@ -224,17 +218,6 @@ abstract class BaseContinuousDistributionTest
     // as the @ParameterizedTest method. These can be overridden by child classes to
     // stream different arguments to the test case.
 
-    /**
-     * Create a stream of arguments containing the distribution to test, the CDF
-     * test points and the test tolerance.
-     *
-     * @return the stream
-     */
-    Stream<Arguments> streamCdfTestPoints() {
-        return streamPoints(ContinuousDistributionTestData::getCdfPoints,
-                            this::createTestTolerance, "cdf test points");
-    }
-
     /**
      * Create a stream of arguments containing the distribution to test, the PDF test points
      * and values, and the test tolerance.
@@ -242,10 +225,9 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testDensity() {
-        return stream(ContinuousDistributionTestData::isDisablePdf,
+        return stream(TestName.PDF,
                       ContinuousDistributionTestData::getPdfPoints,
-                      ContinuousDistributionTestData::getPdfValues,
-                      this::createTestTolerance, "pdf");
+                      ContinuousDistributionTestData::getPdfValues);
     }
 
     /**
@@ -255,10 +237,9 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testLogDensity() {
-        return stream(ContinuousDistributionTestData::isDisableLogPdf,
+        return stream(TestName.LOGPDF,
                       ContinuousDistributionTestData::getPdfPoints,
-                      ContinuousDistributionTestData::getLogPdfValues,
-                      this::createTestTolerance, "logpdf");
+                      ContinuousDistributionTestData::getLogPdfValues);
     }
 
     /**
@@ -268,10 +249,9 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testCumulativeProbability() {
-        return stream(ContinuousDistributionTestData::isDisableCdf,
+        return stream(TestName.CDF,
                       ContinuousDistributionTestData::getCdfPoints,
-                      ContinuousDistributionTestData::getCdfValues,
-                      this::createTestTolerance, "cdf");
+                      ContinuousDistributionTestData::getCdfValues);
     }
 
     /**
@@ -283,10 +263,9 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testSurvivalProbability() {
-        return stream(ContinuousDistributionTestData::isDisableSf,
+        return stream(TestName.SF,
                       ContinuousDistributionTestData::getSfPoints,
-                      ContinuousDistributionTestData::getSfValues,
-                      this::createTestTolerance, "sf");
+                      ContinuousDistributionTestData::getSfValues);
     }
 
     /**
@@ -296,9 +275,9 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testCumulativeProbabilityHighPrecision() {
-        return stream(ContinuousDistributionTestData::getCdfHpPoints,
-                      ContinuousDistributionTestData::getCdfHpValues,
-                      this::createTestHighPrecisionTolerance, "cdf.hp");
+        return stream(TestName.CDF_HP,
+                      ContinuousDistributionTestData::getCdfHpPoints,
+                      ContinuousDistributionTestData::getCdfHpValues);
     }
 
     /**
@@ -308,9 +287,9 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testSurvivalProbabilityHighPrecision() {
-        return stream(ContinuousDistributionTestData::getSfHpPoints,
-                      ContinuousDistributionTestData::getSfHpValues,
-                      this::createTestHighPrecisionTolerance, "sf.hp");
+        return stream(TestName.SF_HP,
+                      ContinuousDistributionTestData::getSfHpPoints,
+                      ContinuousDistributionTestData::getSfHpValues);
     }
 
     /**
@@ -320,9 +299,9 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testInverseCumulativeProbability() {
-        return stream(ContinuousDistributionTestData::getIcdfPoints,
-                      ContinuousDistributionTestData::getIcdfValues,
-                      this::createTestTolerance, "icdf");
+        return stream(TestName.ICDF,
+                      ContinuousDistributionTestData::getIcdfPoints,
+                      ContinuousDistributionTestData::getIcdfValues);
     }
 
     /**
@@ -332,9 +311,9 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testInverseSurvivalProbability() {
-        return stream(ContinuousDistributionTestData::getIsfPoints,
-                      ContinuousDistributionTestData::getIsfValues,
-                      this::createTestTolerance, "isf");
+        return stream(TestName.ISF,
+                      ContinuousDistributionTestData::getIsfPoints,
+                      ContinuousDistributionTestData::getIsfValues);
     }
 
     /**
@@ -345,9 +324,8 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testCumulativeProbabilityInverseMapping() {
-        return streamPoints(ContinuousDistributionTestData::isDisableCdfInverse,
-                            ContinuousDistributionTestData::getCdfPoints,
-                            this::createTestTolerance, "cdf test points");
+        return stream(TestName.CDF_MAPPING,
+                      ContinuousDistributionTestData::getCdfPoints);
     }
 
     /**
@@ -358,9 +336,8 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testSurvivalProbabilityInverseMapping() {
-        return streamPoints(ContinuousDistributionTestData::isDisableSfInverse,
-                            ContinuousDistributionTestData::getSfPoints,
-                            this::createTestTolerance, "sf test points");
+        return stream(TestName.SF_MAPPING,
+                      ContinuousDistributionTestData::getSfPoints);
     }
 
     /**
@@ -370,9 +347,10 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testSurvivalAndCumulativeProbabilityComplement() {
-        // This is not disabled based on isDisableCdf && isDisableSf.
+        // This is not disabled based on cdf.disable && sf.disable.
         // Those flags are intended to ignore tests against reference values.
-        return streamCdfTestPoints();
+        return stream(TestName.COMPLEMENT,
+                      ContinuousDistributionTestData::getCdfPoints);
     }
 
     /**
@@ -383,9 +361,10 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testConsistency() {
-        // This is not disabled based on isDisableCdf.
-        // That flags is intended to ignore tests against reference values.
-        return streamCdfTestPoints();
+        // This is not disabled based on cdf.disable.
+        // That flag is intended to ignore tests against reference values.
+        return stream(TestName.CONSISTENCY,
+                      ContinuousDistributionTestData::getCdfPoints);
     }
 
     /**
@@ -394,7 +373,7 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testSampling() {
-        return streamDistributionWithFilter(ContinuousDistributionTestData::isDisableSample, "sampling");
+        return stream(TestName.SAMPLING);
     }
 
     /**
@@ -404,20 +383,17 @@ abstract class BaseContinuousDistributionTest
      * the underlying integrator (abs=1e-10, rel=1e-12).
      * Override this method to change the tolerance.
      *
-     * <p>This is disabled by {@link ContinuousDistributionTestData#isDisablePdf()}. If
-     * the distribution cannot compute the density to match reference values then it
-     * is assumed an integral of the PDF will fail to match reference CDF values.
-     *
      * @return the stream
      */
     Stream<Arguments> testDensityIntegrals() {
         // Create a tolerance suitable for the same thresholds used by the integrator.
         final Function<ContinuousDistributionTestData, DoubleTolerance> tolerance =
             d -> createAbsOrRelTolerance(INTEGRATOR_ABS_ACCURACY * 10, INTEGRATOR_REL_ACCURACY * 10);
-        return stream(ContinuousDistributionTestData::isDisablePdf,
+        final TestName name = TestName.INTEGRALS;
+        return stream(d -> d.isDisabled(name),
                       ContinuousDistributionTestData::getCdfPoints,
                       ContinuousDistributionTestData::getCdfValues,
-                      tolerance, "pdf integrals");
+                      tolerance, name.toString());
     }
 
     /**
@@ -427,7 +403,8 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testSupport() {
-        return data.stream().map(d -> Arguments.of(namedDistribution(d.getParameters()), d.getLower(), d.getUpper()));
+        return streamArguments(TestName.SUPPORT,
+            d -> Arguments.of(namedDistribution(d.getParameters()), d.getLower(), d.getUpper()));
     }
 
     /**
@@ -437,7 +414,10 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testMoments() {
-        return data.stream().map(d -> Arguments.of(namedDistribution(d.getParameters()), d.getMean(), d.getVariance(), createTestTolerance(d)));
+        final TestName name = TestName.MOMENTS;
+        return streamArguments(name,
+            d -> Arguments.of(namedDistribution(d.getParameters()), d.getMean(), d.getVariance(),
+                              createTestTolerance(d, name)));
     }
 
     /**
@@ -446,7 +426,9 @@ abstract class BaseContinuousDistributionTest
      * @return the stream
      */
     Stream<Arguments> testMedian() {
-        return data.stream().map(d -> Arguments.of(namedDistribution(d.getParameters()), createTestTolerance(d)));
+        final TestName name = TestName.MEDIAN;
+        return streamArguments(name,
+            d -> Arguments.of(namedDistribution(d.getParameters()), createTestTolerance(d, name)));
     }
 
     //------------------------ Tests -----------------------------
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
index 6253e56..c38483a 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDiscreteDistributionTest.java
@@ -65,7 +65,7 @@ import org.junit.jupiter.params.provider.MethodSource;
  * The parameters are parsed from String values to the appropriate parameter object. Currently
  * this supports Double and Integer; numbers can be unboxed and used to create the distribution.
  *
- * <p>Illegal arguments for the distribution are tested from parametersprovided by
+ * <p>Illegal arguments for the distribution are tested from parameters provided by
  * {@link #makeInvalidParameters()}. If there are no illegal arguments this method may return
  * null to skip the test. Primitive parameters are boxed to objects so ensure the canonical form
  * is used, e.g. {@code 1.0} not {@code 1} for a {@code double} argument.
@@ -87,13 +87,11 @@ import org.junit.jupiter.params.provider.MethodSource;
  * <li>Points for the PMF (and log PMF) can be specified. The default will use the CDF points.
  * Note: It is not expected that evaluation of the PMF will require different points to the CDF.
  * <li>Points and expected values for the inverse CDF can be specified. These are used in
- * addition to test the inverse mapping of the CDF values to the CDF test points. The
- * inverse mapping test can be disabled.
+ * addition to test the inverse mapping of the CDF values to the CDF test points.
  * <li>Expected values for the log PMF can be specified. The default will use
  * {@link Math#log(double)} on the PMF values.
  * <li>Points and expected values for the survival function can be specified. These are used in
- * addition to test the inverse mapping of the SF values to the SF test points. The
- * inverse mapping test can be disabled.
+ * addition to test the inverse mapping of the SF values to the SF test points.
  * The default will use the expected CDF values (SF = 1 - CDF).
  * <li>A tolerance for equality assertions. The default is set by {@link #getAbsoluteTolerance()}
  * and {@link #getRelativeTolerance()}.
@@ -101,9 +99,19 @@ import org.junit.jupiter.params.provider.MethodSource;
  *
  * <p>If the distribution provides higher precision implementations of
  * cumulative probability and/or survival probability as the values approach zero, then test
- * points and expected values can be provided with a tolerance for equality assertions of
- * high-precision computations. The default is set by {@link #getHighPrecisionAbsoluteTolerance()}
- * and {@link #getHighPrecisionRelativeTolerance()}.
+ * points and expected values can be provided for high-precision computations. If the default
+ * absolute tolerance has been set to non-zero, then very small p-values will require the
+ * high-precision absolute tolerance is configured for the test to a suitable magnitude (see below).
+ *
+ * <p>Per-test configuration
+ *
+ * <p>Each test is identified with a {@link TestName} key in the properties file. This key
+ * can be used to set a per-test tolerance, or disable the test:
+ * <pre>
+ * cdf.hp.relative = 1e-14
+ * cdf.hp.absolute = 1e-50
+ * sampling.disable
+ * </pre>
  *
  * <p>Note: All properties files are read during test initialization. Any errors in a single
  * property file will throw an exception, invalidating the initialization and no tests
@@ -136,7 +144,7 @@ import org.junit.jupiter.params.provider.MethodSource;
  *
  * <p>The properties file uses {@code key=value} pairs loaded using a
  * {@link java.util.Properties} object. Values will be read as String and then parsed to
- * numeric data, and data arrays. Multi-line values can use a {@code \} character.
+ * numeric data, and data arrays. Multi-line values can use a {@code \} character to join lines.
  * Data in the properties file will be converted to numbers using standard parsing
  * functions appropriate to the primitive type, e.g. {@link Double#parseDouble(String)}.
  * Special double values should use NaN, Infinity and -Infinity. As a convenience
@@ -158,10 +166,6 @@ import org.junit.jupiter.params.provider.MethodSource;
  * tolerance.relative = 1e-9
  * # optional (default 0.0 or over-ridden in getAbsoluteTolerance())
  * tolerance.absolute = 0.0
- * # optional (default 1e-12 or over-ridden in getHighPrecisionRelativeTolerance())
- * tolerance.relative.hp = 1e-10
- * # optional (default 0.0 or over-ridden in getHighPrecisionAbsoluteTolerance())
- * tolerance.absolute.hp = 1e-30
  * cdf.points = 0, 2
  * cdf.values = 0.0, 0.5
  * # optional (default uses cdf.points)
@@ -185,22 +189,10 @@ import org.junit.jupiter.params.provider.MethodSource;
  * # optional inverse CDF test (defaults to ignore)
  * isf.points = 1.0, 0.5
  * isf.values = 3, 4
- * # CDF inverse mapping test (default false)
- * disable.cdf.inverse = false
- * # SF inverse mapping test (default false)
- * disable.sf.inverse = false
- * # Sampling test (default false)
- * disable.sample = false
- * # PMF values test (default false)
- * disable.pmf = false
- * # Log PMF values test (default false)
- * disable.logpmf = false
- * # CDF values test (default false)
- * disable.cdf = false
- * # Survival function values test (default false)
- * disable.sf = false
- * # Sampling PMF summation verses CDF test (default false)
- * disable.pmf.sum = false
+ * # Optional per-test tolerance and disable
+ * cdf.hp.relative = 1e-14
+ * cdf.hp.absolute = 1e-50
+ * sampling.disable = true
  * </pre>
  *
  * <p>See {@link BinomialDistributionTest} for an example and the resource file {@code test.binomial.1.properties}.
@@ -224,14 +216,15 @@ abstract class BaseDiscreteDistributionTest
     // stream different arguments to the test case.
 
     /**
-     * Create a stream of arguments containing the distribution to test, the CDF test points and
-     * the test tolerance.
+     * Create a stream of arguments containing the distribution to test, the CDF test
+     * points and the test tolerance.
      *
+     * @param name Name of the function under test
      * @return the stream
      */
-    Stream<Arguments> streamCdfTestPoints() {
-        return streamPoints(DiscreteDistributionTestData::getCdfPoints,
-                            this::createTestTolerance, "cdf test points");
+    Stream<Arguments> streamCdfTestPoints(TestName name) {
+        return stream(name,
+                      DiscreteDistributionTestData::getCdfPoints);
     }
 
     /**
@@ -241,10 +234,9 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testProbability() {
-        return stream(DiscreteDistributionTestData::isDisablePmf,
+        return stream(TestName.PMF,
                       DiscreteDistributionTestData::getPmfPoints,
-                      DiscreteDistributionTestData::getPmfValues,
-                      this::createTestTolerance, "pmf");
+                      DiscreteDistributionTestData::getPmfValues);
     }
 
     /**
@@ -254,10 +246,9 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testLogProbability() {
-        return stream(DiscreteDistributionTestData::isDisableLogPmf,
+        return stream(TestName.LOGPMF,
                       DiscreteDistributionTestData::getPmfPoints,
-                      DiscreteDistributionTestData::getLogPmfValues,
-                      this::createTestTolerance, "logpmf");
+                      DiscreteDistributionTestData::getLogPmfValues);
     }
 
     /**
@@ -267,10 +258,9 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testCumulativeProbability() {
-        return stream(DiscreteDistributionTestData::isDisableCdf,
+        return stream(TestName.CDF,
                       DiscreteDistributionTestData::getCdfPoints,
-                      DiscreteDistributionTestData::getCdfValues,
-                      this::createTestTolerance, "cdf");
+                      DiscreteDistributionTestData::getCdfValues);
     }
 
     /**
@@ -282,10 +272,9 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testSurvivalProbability() {
-        return stream(DiscreteDistributionTestData::isDisableSf,
+        return stream(TestName.SF,
                       DiscreteDistributionTestData::getSfPoints,
-                      DiscreteDistributionTestData::getSfValues,
-                      this::createTestTolerance, "sf");
+                      DiscreteDistributionTestData::getSfValues);
     }
 
     /**
@@ -295,9 +284,9 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testCumulativeProbabilityHighPrecision() {
-        return stream(DiscreteDistributionTestData::getCdfHpPoints,
-                      DiscreteDistributionTestData::getCdfHpValues,
-                      this::createTestHighPrecisionTolerance, "cdf.hp");
+        return stream(TestName.CDF_HP,
+                      DiscreteDistributionTestData::getCdfHpPoints,
+                      DiscreteDistributionTestData::getCdfHpValues);
     }
 
     /**
@@ -307,9 +296,9 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testSurvivalProbabilityHighPrecision() {
-        return stream(DiscreteDistributionTestData::getSfHpPoints,
-                      DiscreteDistributionTestData::getSfHpValues,
-                      this::createTestHighPrecisionTolerance, "sf.hp");
+        return stream(TestName.SF_HP,
+                      DiscreteDistributionTestData::getSfHpPoints,
+                      DiscreteDistributionTestData::getSfHpValues);
     }
 
     /**
@@ -319,8 +308,9 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testInverseCumulativeProbability() {
-        return stream(DiscreteDistributionTestData::getIcdfPoints,
-                      DiscreteDistributionTestData::getIcdfValues, "icdf");
+        return stream(TestName.ICDF,
+                      DiscreteDistributionTestData::getIcdfPoints,
+                      DiscreteDistributionTestData::getIcdfValues);
     }
 
     /**
@@ -330,8 +320,9 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testInverseSurvivalProbability() {
-        return stream(DiscreteDistributionTestData::getIsfPoints,
-                      DiscreteDistributionTestData::getIsfValues, "isf");
+        return stream(TestName.ISF,
+                      DiscreteDistributionTestData::getIsfPoints,
+                      DiscreteDistributionTestData::getIsfValues);
     }
 
     /**
@@ -340,9 +331,8 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testCumulativeProbabilityInverseMapping() {
-        return stream(DiscreteDistributionTestData::isDisableCdfInverse,
-                      DiscreteDistributionTestData::getCdfPoints,
-                      "cdf test points");
+        return stream(TestName.CDF_MAPPING,
+                      DiscreteDistributionTestData::getCdfPoints);
     }
 
     /**
@@ -351,9 +341,8 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testSurvivalProbabilityInverseMapping() {
-        return stream(DiscreteDistributionTestData::isDisableSfInverse,
-                      DiscreteDistributionTestData::getSfPoints,
-                      "sf test points");
+        return stream(TestName.SF_MAPPING,
+                      DiscreteDistributionTestData::getSfPoints);
     }
 
     /**
@@ -363,9 +352,9 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testSurvivalAndCumulativeProbabilityComplement() {
-        // This is not disabled based on isDisableCdf && isDisableSf.
+        // This is not disabled based on cdf.disable && sf.disable.
         // Those flags are intended to ignore tests against reference values.
-        return streamCdfTestPoints();
+        return streamCdfTestPoints(TestName.COMPLEMENT);
     }
 
     /**
@@ -376,9 +365,9 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testConsistency() {
-        // This is not disabled based on isDisableCdf.
-        // That flags is intended to ignore tests against reference values.
-        return streamCdfTestPoints();
+        // This is not disabled based on cdf.disable.
+        // That flag is intended to ignore tests against reference values.
+        return streamCdfTestPoints(TestName.CONSISTENCY);
     }
 
     /**
@@ -387,7 +376,7 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testOutsideSupport() {
-        return data.stream().map(d -> Arguments.of(namedDistribution(d.getParameters()), createTestTolerance(d)));
+        return stream(TestName.OUTSIDE_SUPPORT);
     }
 
     /**
@@ -396,10 +385,10 @@ abstract class BaseDiscreteDistributionTest
      *
      * @return the stream
      */
-    Stream<Arguments> testSampling() {
-        return stream(DiscreteDistributionTestData::isDisableSample,
+    Stream<Arguments> testSamplingPMF() {
+        return stream(TestName.SAMPLING_PMF,
                       DiscreteDistributionTestData::getPmfPoints,
-                      DiscreteDistributionTestData::getPmfValues, "pmf sampling");
+                      DiscreteDistributionTestData::getPmfValues);
     }
 
     /**
@@ -410,8 +399,8 @@ abstract class BaseDiscreteDistributionTest
      *
      * @return the stream
      */
-    Stream<Arguments> testSamplingQuartiles() {
-        return streamDistributionWithFilter(DiscreteDistributionTestData::isDisableSample, "sampling quartiles");
+    Stream<Arguments> testSampling() {
+        return stream(TestName.SAMPLING);
     }
 
     /**
@@ -421,22 +410,21 @@ abstract class BaseDiscreteDistributionTest
      * of single points of the CDF.
      * Override this method to change the tolerance.
      *
-     * <p>This is disabled by {@link DiscreteDistributionTestData#isDisablePmf()}. If
-     * the distribution cannot compute the PMF to match reference values then it
-     * is assumed a sum of the PMF will fail to match reference CDF values.
-     *
      * @return the stream
      */
     Stream<Arguments> testProbabilitySums() {
         // Assume the the test tolerance for single CDF values can be relaxed slightly
         // when summing values.
         final double scale = 10;
+        final TestName cdf = TestName.CDF;
         final Function<DiscreteDistributionTestData, DoubleTolerance> tolerance =
-            d -> createAbsOrRelTolerance(d.getAbsoluteTolerance() * scale, d.getRelativeTolerance() * scale);
-        return stream(d -> d.isDisablePmf() || d.isDisablePmfSum(),
+            d -> createAbsOrRelTolerance(d.getAbsoluteTolerance(cdf) * scale,
+                                         d.getRelativeTolerance(cdf) * scale);
+        final TestName name = TestName.PMF_SUM;
+        return stream(d -> d.isDisabled(name),
                       DiscreteDistributionTestData::getCdfPoints,
                       DiscreteDistributionTestData::getCdfValues,
-                      tolerance, "pmf sums");
+                      tolerance, name.toString());
     }
 
     /**
@@ -446,7 +434,8 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testSupport() {
-        return data.stream().map(d -> Arguments.of(namedDistribution(d.getParameters()), d.getLower(), d.getUpper()));
+        return streamArguments(TestName.SUPPORT,
+            d -> Arguments.of(namedDistribution(d.getParameters()), d.getLower(), d.getUpper()));
     }
 
     /**
@@ -456,7 +445,10 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testMoments() {
-        return data.stream().map(d -> Arguments.of(namedDistribution(d.getParameters()), d.getMean(), d.getVariance(), createTestTolerance(d)));
+        final TestName name = TestName.MOMENTS;
+        return streamArguments(name,
+            d -> Arguments.of(namedDistribution(d.getParameters()), d.getMean(), d.getVariance(),
+                              createTestTolerance(d, name)));
     }
 
     /**
@@ -465,7 +457,8 @@ abstract class BaseDiscreteDistributionTest
      * @return the stream
      */
     Stream<Arguments> testMedian() {
-        return data.stream().map(d -> Arguments.of(namedDistribution(d.getParameters())));
+        return streamArguments(TestName.MEDIAN,
+            d -> Arguments.of(namedDistribution(d.getParameters())));
     }
 
     //------------------------ Tests -----------------------------
@@ -942,12 +935,14 @@ abstract class BaseDiscreteDistributionTest
 
     /**
      * Test sampling from the distribution.
+     * This test uses the points that are used to test the distribution PMF.
+     * The test is skipped if the sum of the PMF values is less than 0.5.
      */
     @ParameterizedTest
     @MethodSource
-    final void testSampling(DiscreteDistribution dist,
-                            int[] points,
-                            double[] values) {
+    final void testSamplingPMF(DiscreteDistribution dist,
+                               int[] points,
+                               double[] values) {
         // This test uses the points that are used to test the distribution PMF.
         // The sum of the probability values does not have to be 1 (or very close to 1).
         // Any value generated by the sampler that is not an expected point will
@@ -1002,12 +997,12 @@ abstract class BaseDiscreteDistributionTest
      * Test sampling from the distribution using quartiles.
      * This test is ignored if the range for the distribution PMF is small
      * and the quartiles do not map to approximately 0.25. When the range of
-     * the distribution is small then the {@link #testSampling(DiscreteDistribution, int[], double[])}
+     * the distribution is small then the {@link #testSamplingPMF(DiscreteDistribution, int[], double[])}
      * method should be used with points that covers at least 50% of the PMF.
      */
     @ParameterizedTest
     @MethodSource
-    final void testSamplingQuartiles(DiscreteDistribution dist) {
+    final void testSampling(DiscreteDistribution dist) {
         final int[] quartiles = TestUtils.getDistributionQuartiles(dist);
         // The distribution quartiles are created using the inverse CDF.
         // This may not be accurate for extreme parameterizations of the distribution.
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java
index aa7da83..e669a3a 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/BaseDistributionTest.java
@@ -27,7 +27,6 @@ import java.util.Locale;
 import java.util.Properties;
 import java.util.function.Function;
 import java.util.function.Predicate;
-import java.util.function.ToDoubleFunction;
 import java.util.stream.Stream;
 import java.util.stream.Stream.Builder;
 import org.junit.jupiter.api.Assertions;
@@ -55,7 +54,7 @@ import org.junit.jupiter.params.provider.MethodSource;
  * <p>The class has two specializations for testing {@link ContinuousDistribution} and
  * {@link DiscreteDistribution}. It is not intended to extend this class when creating
  * a test for a new distribution. This class exists for the sole purpose of containing
- * commons functionality to search for and load properties files containing the distribution
+ * common functionality to search for and load properties files containing the distribution
  * data.
  *
  * <p>To test a new distribution extend the specialized classes:
@@ -105,8 +104,6 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
         final Properties defaults = new Properties();
         defaults.setProperty(DistributionTestData.KEY_TOLERANCE_ABSOLUTE, String.valueOf(getAbsoluteTolerance()));
         defaults.setProperty(DistributionTestData.KEY_TOLERANCE_RELATIVE, String.valueOf(getRelativeTolerance()));
-        defaults.setProperty(DistributionTestData.KEY_TOLERANCE_ABSOLUTE_HP, String.valueOf(getHighPrecisionAbsoluteTolerance()));
-        defaults.setProperty(DistributionTestData.KEY_TOLERANCE_RELATIVE_HP, String.valueOf(getHighPrecisionRelativeTolerance()));
         for (int i = 1; ; i++) {
             final String filename = String.format("test.%s.%d.properties", key, i);
             try (InputStream resource = this.getClass().getResourceAsStream(
@@ -161,42 +158,6 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
         return 1e-12;
     }
 
-    /**
-     * Gets the default absolute tolerance used in comparing expected and returned values in high precision tests.
-     *
-     * <p>The initial value is 0.0 (disabled).
-     *
-     * <p>Override this method to set the <strong>default</strong> high-precision absolute tolerance for all test
-     * cases defined by a properties file. Any properties file with a high-precision absolute tolerance entry
-     * ignores this value.
-     *
-     * <p>Notes: Floating-point values are considered equal using the absolute or the relative tolerance.
-     * See {@link #createHighPrecisionTolerance()}.
-     *
-     * @return the high precision absolute tolerance
-     */
-    protected double getHighPrecisionAbsoluteTolerance() {
-        return 0.0;
-    }
-
-    /**
-     * Gets the default relative tolerance used in comparing expected and returned values in high precision tests.
-     *
-     * <p>The initial value is 1e-12.
-     *
-     * <p>Override this method to set the <strong>default</strong> high-precision relative tolerance for all test
-     * cases defined by a properties file. Any properties file with a high-precision relative tolerance entry
-     * ignores this value.
-     *
-     * <p>Notes: Floating-point values are considered equal using the absolute or the relative tolerance.
-     * See {@link #createHighPrecisionTolerance()}.
-     *
-     * @return the high precision relative tolerance
-     */
-    protected double getHighPrecisionRelativeTolerance() {
-        return 1e-12;
-    }
-
     /**
      * Gets the distribution name. This is used to search for test case resource files.
      *
@@ -296,27 +257,8 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
     }
 
     /**
-     * Creates the tolerance using an {@code Or} combination of absolute and relative error.
-     *
-     * <p>If the absolute tolerance is zero it is ignored and a tolerance of numerical equality
-     * is used.
-     *
-     * <p>If the relative tolerance is zero it is ignored.
-     *
-     * @param testData Test data
-     * @param absTolerance Function to create the absolute tolerance
-     * @param relTolerance Function to create the relative tolerance
-     * @return the tolerance
-     */
-    DoubleTolerance createTestAbsOrRelTolerance(
-            D testData, ToDoubleFunction<D> absTolerance, ToDoubleFunction<D> relTolerance) {
-        final double abs = absTolerance == null ? 0 : absTolerance.applyAsDouble(testData);
-        final double rel = relTolerance == null ? 0 : relTolerance.applyAsDouble(testData);
-        return createAbsOrRelTolerance(abs, rel);
-    }
-
-    /**
-     * Creates the default tolerance for the test data.
+     * Creates the tolerance using an {@code Or} combination of absolute and relative error
+     * defined in the test data.
      *
      * <p>If the absolute tolerance is zero it is ignored and a tolerance of numerical equality
      * is used.
@@ -327,13 +269,15 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
      * @return the tolerance
      */
     DoubleTolerance createTestTolerance(D testData) {
-        return createTestAbsOrRelTolerance(testData,
-                                           DistributionTestData::getAbsoluteTolerance,
-                                           DistributionTestData::getRelativeTolerance);
+        final double abs = testData.getAbsoluteTolerance();
+        final double rel = testData.getRelativeTolerance();
+        return createAbsOrRelTolerance(abs, rel);
     }
 
     /**
-     * Creates the default high-precision tolerance for the test data.
+     * Creates the tolerance for the named test using an {@code Or} combination of absolute
+     * and relative error defined in the test data. If the named test tolerance is not defined
+     * then this uses the default tolerance.
      *
      * <p>If the absolute tolerance is zero it is ignored and a tolerance of numerical equality
      * is used.
@@ -341,12 +285,13 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
      * <p>If the relative tolerance is zero it is ignored.
      *
      * @param testData Test data
+     * @param name Name of the function under test
      * @return the tolerance
      */
-    DoubleTolerance createTestHighPrecisionTolerance(D testData) {
-        return createTestAbsOrRelTolerance(testData,
-                                           DistributionTestData::getHighPrecisionAbsoluteTolerance,
-                                           DistributionTestData::getHighPrecisionRelativeTolerance);
+    DoubleTolerance createTestTolerance(D testData, TestName name) {
+        final double abs = testData.getAbsoluteTolerance(name);
+        final double rel = testData.getRelativeTolerance(name);
+        return createAbsOrRelTolerance(abs, rel);
     }
 
     /**
@@ -364,21 +309,6 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
                                        getRelativeTolerance());
     }
 
-    /**
-     * Creates the default high-precision tolerance.
-     *
-     * <p>If the absolute tolerance is zero it is ignored and a tolerance of numerical equality
-     * is used.
-     *
-     * <p>If the relative tolerance is zero it is ignored.
-     *
-     * @return the tolerance
-     */
-    DoubleTolerance createHighPrecisionTolerance() {
-        return createAbsOrRelTolerance(getHighPrecisionAbsoluteTolerance(),
-                                       getHighPrecisionRelativeTolerance());
-    }
-
     //------------------------ Methods to stream the test data -----------------------------
 
     // The @MethodSource annotation will default to a no arguments method of the same name
@@ -475,17 +405,6 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
         return Named.of(sb.toString(), array);
     }
 
-    /**
-     * Create a predicate that returns false. This can be used to signal do not ignore
-     * for test data.
-     *
-     * @param <D> Type of object
-     * @return the predicate
-     */
-    private static <D> Predicate<D> doNotIgnore() {
-        return d -> false;
-    }
-
     /**
      * Create a stream of arguments containing the distribution to test.
      *
@@ -496,81 +415,23 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
     }
 
     /**
-     * Create a stream of arguments containing the distribution to test.
+     * Create a stream of arguments containing the distribution to test and the test tolerance.
+     * The tolerance is identified using functions on the test instance data.
+     * The test data will be skipped if disabled.
      *
-     * @param filter Filter applied on the test data. If true the data is ignored.
-     * @param name Name of the function under test
-     * @return the stream
-     */
-    Stream<Arguments> streamDistributionWithFilter(Predicate<D> filter,
-                                                   String name) {
-        final Builder<Arguments> b = Stream.builder();
-        final int[] size = {0};
-        data.forEach(d -> {
-            if (filter.test(d)) {
-                return;
-            }
-            size[0]++;
-            b.accept(Arguments.of(namedDistribution(d.getParameters())));
-        });
-        Assumptions.assumeTrue(size[0] != 0, () -> "Distribution has no data for " + name);
-        return b.build();
-    }
-
-    /**
-     * Create a stream of arguments containing the distribution to test, the test
-     * points, test values and the test tolerance. The points, values and tolerance
-     * are identified using functions on the test instance data.
-     *
-     * <p>If the length of the points or values is zero then a
-     * {@link org.opentest4j.TestAbortedException TestAbortedException} is raised.
-     *
-     * @param points Function to create the points
-     * @param values Function to create the values
-     * @param tolerance Function to create the tolerance
-     * @param name Name of the function under test
-     * @return the stream
-     */
-    <P, V> Stream<Arguments> stream(Function<D, P> points,
-                                    Function<D, V> values,
-                                    ToDoubleFunction<D> tolerance,
-                                    String name) {
-        return stream(doNotIgnore(), points, values, tolerance, name);
-    }
-
-    /**
-     * Create a stream of arguments containing the distribution to test, the test
-     * points, test values and the test tolerance. The points, values and tolerance
-     * are identified using functions on the test instance data.
-     *
-     * <p>If the length of the points or values is zero then a
-     * {@link org.opentest4j.TestAbortedException TestAbortedException} is raised.
-     *
-     * @param filter Filter applied on the test data. If true the data is ignored.
-     * @param points Function to create the points
-     * @param values Function to create the values
-     * @param tolerance Function to create the tolerance
      * @param name Name of the function under test
      * @return the stream
      */
-    <P, V> Stream<Arguments> stream(Predicate<D> filter,
-                                    Function<D, P> points,
-                                    Function<D, V> values,
-                                    ToDoubleFunction<D> tolerance,
-                                    String name) {
+    Stream<Arguments> stream(TestName name) {
         final Builder<Arguments> b = Stream.builder();
         final int[] size = {0};
         data.forEach(d -> {
-            final P p = points.apply(d);
-            final V v = values.apply(d);
-            if (filter.test(d) || TestUtils.getLength(p) == 0 || TestUtils.getLength(v) == 0) {
+            if (d.isDisabled(name)) {
                 return;
             }
             size[0]++;
             b.accept(Arguments.of(namedDistribution(d.getParameters()),
-                     namedArray("points", p),
-                     namedArray("values", v),
-                     tolerance.applyAsDouble(d)));
+                     createTestTolerance(d, name)));
         });
         Assumptions.assumeTrue(size[0] != 0, () -> "Distribution has no data for " + name);
         return b.build();
@@ -580,50 +441,28 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
      * Create a stream of arguments containing the distribution to test, the test
      * points, and the test tolerance. The points and tolerance
      * are identified using functions on the test instance data.
+     * The test data will be skipped if disabled or the length of the points is zero.
      *
-     * <p>If the length of the points is zero then a
+     * <p>If all test data is skipped then a
      * {@link org.opentest4j.TestAbortedException TestAbortedException} is raised.
      *
-     * @param points Function to create the points
-     * @param tolerance Function to create the tolerance
      * @param name Name of the function under test
-     * @return the stream
-     */
-    <P, V> Stream<Arguments> streamPoints(Function<D, P> points,
-                                          Function<D, DoubleTolerance> tolerance,
-                                          String name) {
-        return streamPoints(doNotIgnore(), points, tolerance, name);
-    }
-
-    /**
-     * Create a stream of arguments containing the distribution to test, the test
-     * points, and the test tolerance. The points and tolerance
-     * are identified using functions on the test instance data.
-     *
-     * <p>If the length of the points is zero then a
-     * {@link org.opentest4j.TestAbortedException TestAbortedException} is raised.
-     *
-     * @param filter Filter applied on the test data. If true the data is ignored.
      * @param points Function to create the points
-     * @param tolerance Function to create the tolerance
-     * @param name Name of the function under test
      * @return the stream
      */
-    <P, V> Stream<Arguments> streamPoints(Predicate<D> filter,
-                                          Function<D, P> points,
-                                          Function<D, DoubleTolerance> tolerance,
-                                          String name) {
+    <P> Stream<Arguments> stream(TestName name,
+                                 Function<D, P> points) {
         final Builder<Arguments> b = Stream.builder();
         final int[] size = {0};
         data.forEach(d -> {
             final P p = points.apply(d);
-            if (filter.test(d) || TestUtils.getLength(p) == 0) {
+            if (d.isDisabled(name) || TestUtils.getLength(p) == 0) {
                 return;
             }
             size[0]++;
             b.accept(Arguments.of(namedDistribution(d.getParameters()),
                      namedArray("points", p),
-                     tolerance.apply(d)));
+                     createTestTolerance(d, name)));
         });
         Assumptions.assumeTrue(size[0] != 0, () -> "Distribution has no data for " + name);
         return b.build();
@@ -633,29 +472,34 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
      * Create a stream of arguments containing the distribution to test, the test
      * points, test values and the test tolerance. The points, values and tolerance
      * are identified using functions on the test instance data.
+     * The test data will be skipped if disabled or the length of the points or values is zero.
      *
-     * <p>If the length of the points or values is zero then a
+     * <p>If all test data is skipped then a
      * {@link org.opentest4j.TestAbortedException TestAbortedException} is raised.
      *
+     * @param name Name of the function under test
      * @param points Function to create the points
      * @param values Function to create the values
-     * @param tolerance Function to create the tolerance
-     * @param name Name of the function under test
      * @return the stream
      */
-    <P, V> Stream<Arguments> stream(Function<D, P> points,
-                                    Function<D, V> values,
-                                    Function<D, DoubleTolerance> tolerance,
-                                    String name) {
-        return stream(doNotIgnore(), points, values, tolerance, name);
+    <P, V> Stream<Arguments> stream(TestName name,
+                                    Function<D, P> points,
+                                    Function<D, V> values) {
+        // Delegate
+        return stream(d -> d.isDisabled(name),
+                      points,
+                      values,
+                      d -> createTestTolerance(d, name),
+                      name.toString());
     }
 
     /**
      * Create a stream of arguments containing the distribution to test, the test
      * points, test values and the test tolerance. The points, values and tolerance
      * are identified using functions on the test instance data.
+     * The test data will be skipped if disabled or the length of the points or values is zero.
      *
-     * <p>If the length of the points or values is zero then a
+     * <p>If all test data is skipped then a
      * {@link org.opentest4j.TestAbortedException TestAbortedException} is raised.
      *
      * @param filter Filter applied on the test data. If true the data is ignored.
@@ -689,101 +533,26 @@ abstract class BaseDistributionTest<T, D extends DistributionTestData> {
     }
 
     /**
-     * Create a stream of arguments containing the distribution to test, the test
-     * points, and test values. The points and values
-     * are identified using functions on the test instance data.
-     *
-     * <p>If the length of the points or values is zero then a
-     * {@link org.opentest4j.TestAbortedException TestAbortedException} is raised.
-     *
-     * @param points Function to create the points
-     * @param values Function to create the values
-     * @param name Name of the function under test
-     * @return the stream
-     */
-    <P, V> Stream<Arguments> stream(Function<D, P> points,
-                                    Function<D, V> values,
-                                    String name) {
-        return stream(doNotIgnore(), points, values, name);
-    }
-
-    /**
-     * Create a stream of arguments containing the distribution to test, the test
-     * points, and test values. The points and values
-     * are identified using functions on the test instance data.
-     *
-     * <p>If the length of the points or values is zero then a
-     * {@link org.opentest4j.TestAbortedException TestAbortedException} is raised.
-     *
-     * @param filter Filter applied on the test data. If true the data is ignored.
-     * @param points Function to create the points
-     * @param values Function to create the values
-     * @param name Name of the function under test
-     * @return the stream
-     */
-    <P, V> Stream<Arguments> stream(Predicate<D> filter,
-                                    Function<D, P> points,
-                                    Function<D, V> values,
-                                    String name) {
-        final Builder<Arguments> b = Stream.builder();
-        final int[] size = {0};
-        data.forEach(d -> {
-            final P p = points.apply(d);
-            final V v = values.apply(d);
-            if (filter.test(d) || TestUtils.getLength(p) == 0 || TestUtils.getLength(v) == 0) {
-                return;
-            }
-            size[0]++;
-            b.accept(Arguments.of(namedDistribution(d.getParameters()),
-                     namedArray("points", p),
-                     namedArray("values", v)));
-        });
-        Assumptions.assumeTrue(size[0] != 0, () -> "Distribution has no data for " + name);
-        return b.build();
-    }
-
-
-    /**
-     * Create a stream of arguments containing the distribution to test and the test
-     * points. The points are identified using functions on the test instance data.
-     *
-     * <p>If the length of the points or values is zero then a
-     * {@link org.opentest4j.TestAbortedException TestAbortedException} is raised.
-     *
-     * @param points Function to create the points
-     * @param name Name of the function under test
-     * @return the stream
-     */
-    <P> Stream<Arguments> stream(Function<D, P> points,
-                                 String name) {
-        return stream(doNotIgnore(), points, name);
-    }
-
-    /**
-     * Create a stream of arguments containing the distribution to test and the test
-     * points. The points are identified using functions on the test instance data.
+     * Create a stream of arguments built using the provided mapping function.
+     * The test data will be skipped if disabled.
      *
-     * <p>If the length of the points or values is zero then a
+     * <p>If all test data is skipped then a
      * {@link org.opentest4j.TestAbortedException TestAbortedException} is raised.
      *
-     * @param filter Filter applied on the test data. If true the data is ignored.
-     * @param points Function to create the points
      * @param name Name of the function under test
+     * @param mappingFunction Function to create the arguments for the test data
      * @return the stream
      */
-    <P> Stream<Arguments> stream(Predicate<D> filter,
-                                 Function<D, P> points,
-                                 String name) {
+    Stream<Arguments> streamArguments(TestName name,
+                                      Function<D, Arguments> mappingFunction) {
         final Builder<Arguments> b = Stream.builder();
         final int[] size = {0};
         data.forEach(d -> {
-            final P p = points.apply(d);
-            if (filter.test(d) || TestUtils.getLength(p) == 0) {
+            if (d.isDisabled(name)) {
                 return;
             }
             size[0]++;
-            b.accept(Arguments.of(namedDistribution(d.getParameters()),
-                     namedArray("points", p)));
+            b.accept(mappingFunction.apply(d));
         });
         Assumptions.assumeTrue(size[0] != 0, () -> "Distribution has no data for " + name);
         return b.build();
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/DistributionTestData.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/DistributionTestData.java
index 747192b..c05ae93 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/DistributionTestData.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/DistributionTestData.java
@@ -17,8 +17,13 @@
 package org.apache.commons.statistics.distribution;
 
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.EnumSet;
+import java.util.Map;
 import java.util.Objects;
 import java.util.Properties;
+import java.util.Set;
 import java.util.regex.Pattern;
 
 /**
@@ -35,10 +40,21 @@ abstract class DistributionTestData {
     static final String KEY_TOLERANCE_ABSOLUTE = "tolerance.absolute";
     /** The key for the relative tolerance value. */
     static final String KEY_TOLERANCE_RELATIVE = "tolerance.relative";
-    /** The key for the high-precision absolute tolerance value. */
-    static final String KEY_TOLERANCE_ABSOLUTE_HP = "tolerance.absolute.hp";
-    /** The key for the high-precision relative tolerance value. */
-    static final String KEY_TOLERANCE_RELATIVE_HP = "tolerance.relative.hp";
+
+    /** The key suffix to disable a test. */
+    private static final String SUFFIX_DISABLE = ".disable";
+    /** The key suffix for the absolute tolerance value. */
+    private static final String SUFFIX_TOLERANCE_ABSOLUTE = ".absolute";
+    /** The key suffix for the relative tolerance value. */
+    private static final String SUFFIX_TOLERANCE_RELATIVE = ".relative";
+    /** The index for the absolute tolerance value in the array of tolerances. */
+    private static final int INDEX_ABSOLUTE = 0;
+    /** The index for the relative tolerance value in the array of tolerances. */
+    private static final int INDEX_RELATIVE = 1;
+    /** The unset (default) value for the tolerance. */
+    private static final double UNSET_TOLERANCE = -1;
+    /** The unset (default) values for the array of tolerances. */
+    private static final double[] UNSET_TOLERANCES = {UNSET_TOLERANCE, UNSET_TOLERANCE};
 
     /** Regex to split delimited text data (e.g. arrays of numbers). */
     private static final Pattern PATTERN = Pattern.compile("[ ,]+");
@@ -47,10 +63,6 @@ abstract class DistributionTestData {
     protected final double[] pfValues;
     /** Expected log probability function values. */
     protected final double[] logPfValues;
-    /** Disable tests of the probability function method. */
-    protected final boolean disablePf;
-    /** Disable tests of the log probability function method. */
-    protected final boolean disableLogPf;
 
     /** Distribution parameters. */
     private final Object[] parameters;
@@ -58,14 +70,15 @@ abstract class DistributionTestData {
     private final double mean;
     /** Variance. */
     private final double variance;
+    /** Test tolerances. */
+    private final Map<TestName, double[]> tolerance;
+    /** Disabled tests. */
+    private final Set<TestName> disabled;
+
     /** Test absolute tolerance for calculations. */
     private final double absoluteTolerance;
     /** Test relative tolerance for calculations. */
     private final double relativeTolerance;
-    /** Test absolute tolerance for high-precision calculations.. */
-    private final double absoluteToleranceHp;
-    /** Test relative tolerance for high-precision calculations.. */
-    private final double relativeToleranceHp;
     /** Expected CDF values. */
     private final double[] cdfValues;
     /** Expected SF values for the survival function test points. */
@@ -75,19 +88,6 @@ abstract class DistributionTestData {
     /** Expected CDF values for the high-precision survival function test points. */
     private final double[] sfHpValues;
 
-    // Flags to ignore required tests
-
-    /** Disable a {@code x = icdf(cdf(x))} mapping test. */
-    private final boolean disableCdfInverse;
-    /** Disable a {@code x = isf(sf(x))} mapping test. */
-    private final boolean disableSfInverse;
-    /** Disable tests of the sample method. */
-    private final boolean disableSample;
-    /** Disable tests of the cumulative probability function method. */
-    private final boolean disableCdf;
-    /** Disable tests of the survival probability function method. */
-    private final boolean disableSf;
-
     /**
      * Contains the data for the continuous distribution parameters, the expected properties
      * of the distribution (moments and support bounds) and test points to evaluate
@@ -264,26 +264,6 @@ abstract class DistributionTestData {
         double[] getIsfValues() {
             return isfValues;
         }
-
-        /**
-         * Checks if a test of the PDF method is disabled.
-         *
-         * @return true if a PDF test is disabled.
-         * @see #getPdfValues()
-         */
-        boolean isDisablePdf() {
-            return disablePf;
-        }
-
-        /**
-         * Checks if a test of the log PDF method is disabled.
-         *
-         * @return true if a log PDF test is disabled.
-         * @see #getLogPdfValues()
-         */
-        boolean isDisableLogPdf() {
-            return disableLogPf;
-        }
     }
 
     /**
@@ -314,8 +294,6 @@ abstract class DistributionTestData {
         private final double[] isfPoints;
         /** Expected inverse SF values. */
         private final int[] isfValues;
-        /** Disable tests of the summation of the PMF verses the CDF. */
-        private final boolean disablePmfSum;
 
         /**
          * @param props Properties containing the test data
@@ -338,7 +316,6 @@ abstract class DistributionTestData {
             icdfValues = getAsIntArray(props, "icdf.values", null);
             isfPoints = getAsDoubleArray(props, "isf.points", null);
             isfValues = getAsIntArray(props, "isf.values", null);
-            disablePmfSum = getAsBoolean(props, "disable.pmf.sum", false);
             // Validation
             validatePair(cdfPoints, getCdfValues(), "cdf");
             validatePair(pmfPoints, getPmfValues(), "pmf");
@@ -465,36 +442,6 @@ abstract class DistributionTestData {
         int[] getIsfValues() {
             return isfValues;
         }
-
-        /**
-         * Checks if a test of the PMF method is disabled.
-         *
-         * @return true if a PMF test is disabled.
-         * @see #getPmfValues()
-         */
-        boolean isDisablePmf() {
-            return disablePf;
-        }
-
-        /**
-         * Checks if a test of the log PMF method is disabled.
-         *
-         * @return true if a log PMF test is disabled.
-         * @see #getLogPmfValues()
-         */
-        boolean isDisableLogPmf() {
-            return disableLogPf;
-        }
-
-        /**
-         * Checks if a test of the sum of the PMF verses the PDF is disabled.
-         *
-         * @return true the PMF sum test is disabled.
-         * @see #getSfValues()
-         */
-        boolean isDisablePmfSum() {
-            return disablePmfSum;
-        }
     }
 
     /**
@@ -507,9 +454,7 @@ abstract class DistributionTestData {
         mean = getAsDouble(props, "mean");
         variance = getAsDouble(props, "variance");
         absoluteTolerance = getAsDouble(props, KEY_TOLERANCE_ABSOLUTE);
-        absoluteToleranceHp = getAsDouble(props, KEY_TOLERANCE_ABSOLUTE_HP);
         relativeTolerance = getAsDouble(props, KEY_TOLERANCE_RELATIVE);
-        relativeToleranceHp = getAsDouble(props, KEY_TOLERANCE_RELATIVE_HP);
         // Required
         cdfValues = getAsDoubleArray(props, "cdf.values");
         final String pf = getProbabilityFunctionName();
@@ -527,13 +472,37 @@ abstract class DistributionTestData {
         sfValues = tmp;
         cdfHpValues = getAsDoubleArray(props, "cdf.hp.values", null);
         sfHpValues = getAsDoubleArray(props, "sf.hp.values", null);
-        disableCdfInverse = getAsBoolean(props, "disable.cdf.inverse", false);
-        disableSfInverse = getAsBoolean(props, "disable.sf.inverse", false);
-        disableSample = getAsBoolean(props, "disable.sample", false);
-        disablePf = getAsBoolean(props, "disable." + pf, false);
-        disableLogPf = getAsBoolean(props, "disable." + pf, false);
-        disableCdf = getAsBoolean(props, "disable.cdf", false);
-        disableSf = getAsBoolean(props, "disable.sf", false);
+
+        // Remove keys to prevent detection in when searching for test tolerances
+        props.remove(KEY_TOLERANCE_ABSOLUTE);
+        props.remove(KEY_TOLERANCE_RELATIVE);
+
+        // Store custom tolerances and disabled tests
+        EnumMap<TestName, double[]> map = new EnumMap<>(TestName.class);
+        EnumSet<TestName> set = EnumSet.noneOf(TestName.class);
+        props.stringPropertyNames().forEach(key -> {
+            if (key.endsWith(SUFFIX_DISABLE) && getAsBoolean(props, key, false)) {
+                final TestName name = TestName.fromString(key.substring(0, key.length() - SUFFIX_DISABLE.length()));
+                if (name != null) {
+                    set.add(name);
+                }
+            } else if (key.endsWith(SUFFIX_TOLERANCE_ABSOLUTE)) {
+                final TestName name = TestName.fromString(key.substring(0, key.length() - SUFFIX_TOLERANCE_ABSOLUTE.length()));
+                if (name != null) {
+                    final double[] tolerances = map.computeIfAbsent(name, k -> UNSET_TOLERANCES.clone());
+                    tolerances[INDEX_ABSOLUTE] = getAsDouble(props, key);
+                }
+            } else if (key.endsWith(SUFFIX_TOLERANCE_RELATIVE)) {
+                final TestName name = TestName.fromString(key.substring(0, key.length() - SUFFIX_TOLERANCE_RELATIVE.length()));
+                if (name != null) {
+                    final double[] tolerances = map.computeIfAbsent(name, k -> UNSET_TOLERANCES.clone());
+                    tolerances[INDEX_RELATIVE] = getAsDouble(props, key);
+                }
+            }
+        });
+
+        this.tolerance = map.isEmpty() ? Collections.emptyMap() : map;
+        this.disabled = set.isEmpty() ? Collections.emptySet() : set;
     }
 
     /**
@@ -681,22 +650,6 @@ abstract class DistributionTestData {
         }
     }
 
-    /**
-     * Gets the property as a boolean, or a default value if the property is missing.
-     *
-     * @param props Properties
-     * @param key Key
-     * @return the value
-     * @throws IllegalArgumentException if the parameter is not a boolean.
-     */
-    private static boolean getAsBoolean(Properties props, String key) {
-        try {
-            return Boolean.parseBoolean(props.getProperty(key));
-        } catch (NumberFormatException ex) {
-            throw new IllegalArgumentException("Invalid boolean: " + key, ex);
-        }
-    }
-
     /**
      * Gets the property as a boolean, or a default value if the property is missing.
      *
@@ -863,6 +816,45 @@ abstract class DistributionTestData {
 
     /**
      * Gets the absolute tolerance used when comparing expected and actual results.
+     * If no tolerance exists for the named test then the default is returned.
+     *
+     * @param name Name of the test.
+     * @return the absolute tolerance
+     */
+    double getAbsoluteTolerance(TestName name) {
+        return getTolerance(name, INDEX_ABSOLUTE, absoluteTolerance);
+    }
+
+    /**
+     * Gets the relative tolerance used when comparing expected and actual results.
+     * If no tolerance exists for the named test then the default is returned.
+     *
+     * @param name Name of the test.
+     * @return the relative tolerance
+     */
+    double getRelativeTolerance(TestName name) {
+        return getTolerance(name, INDEX_RELATIVE, relativeTolerance);
+    }
+
+    /**
+     * Gets the specified tolerance for the named test.
+     * If no tolerance exists for the named test then the default is returned.
+     *
+     * @param name Name of the test.
+     * @param index Index of the tolerance.
+     * @param defaultValue Default value is the tolerance is unset.
+     * @return the relative tolerance
+     */
+    private double getTolerance(TestName name, int index, double defaultValue) {
+        final double[] tol = tolerance.get(name);
+        if (tol != null && tol[index] != UNSET_TOLERANCE) {
+            return tol[index];
+        }
+        return defaultValue;
+    }
+
+    /**
+     * Gets the default absolute tolerance used when comparing expected and actual results.
      *
      * @return the absolute tolerance
      */
@@ -871,7 +863,7 @@ abstract class DistributionTestData {
     }
 
     /**
-     * Gets the relative tolerance used when comparing expected and actual results.
+     * Gets the default relative tolerance used when comparing expected and actual results.
      *
      * @return the relative tolerance
      */
@@ -880,23 +872,23 @@ abstract class DistributionTestData {
     }
 
     /**
-     * Gets the absolute tolerance used when comparing expected and actual results
-     * of high-precision computations.
+     * Checks if the named test is disabled.
      *
-     * @return the high-precision absolute tolerance
+     * @param name Name of the test.
+     * @return true if test is disabled.
      */
-    double getHighPrecisionAbsoluteTolerance() {
-        return absoluteToleranceHp;
+    boolean isDisabled(TestName name) {
+        return disabled.contains(name);
     }
 
     /**
-     * Gets the relative tolerance used when comparing expected and actual results
-     * of high-precision computations.
+     * Checks if the named test is enabled.
      *
-     * @return the high-precision relative tolerance
+     * @param name Name of the test.
+     * @return true if test is enabled.
      */
-    double getHighPrecisionRelativeTolerance() {
-        return relativeToleranceHp;
+    boolean isEnabled(TestName name) {
+        return !isDisabled(name);
     }
 
     /**
@@ -948,62 +940,5 @@ abstract class DistributionTestData {
      * @return the inverse SF points
      */
     abstract double[] getIsfPoints();
-
-    /**
-     * Checks if a {@code x = icdf(cdf(x))} mapping test is disabled.
-     *
-     * <p>Note that this property disables a round-trip test of the points used to test
-     * the cumulative probability. The inverse cumulative probability can also be tested
-     * separately using the {@link #getIcdfPoints()} allowing the forward and reverse
-     * functions to target different data.
-     *
-     * @return true if a CDF inverse mapping test is disabled.
-     */
-    boolean isDisableCdfInverse() {
-        return disableCdfInverse;
-    }
-
-    /**
-     * Checks if a {@code x = isf(sf(x))} mapping test is disabled.
-     *
-     * <p>Note that this property disables a round-trip test of the points used to test
-     * the survival probability. The inverse survival probability can also be tested
-     * separately using the {@link #getIsfPoints()} allowing the forward and reverse
-     * functions to target different data.
-     *
-     * @return true if a SF inverse mapping test is disabled.
-     */
-    boolean isDisableSfInverse() {
-        return disableSfInverse;
-    }
-
-    /**
-     * Checks if a test of the sample method is disabled.
-     *
-     * @return true if a sample test is disabled.
-     */
-    boolean isDisableSample() {
-        return disableSample;
-    }
-
-    /**
-     * Checks if a test of the CDF method is disabled.
-     *
-     * @return true if a CDF test is disabled.
-     * @see #getCdfValues()
-     */
-    boolean isDisableCdf() {
-        return disableCdf;
-    }
-
-    /**
-     * Checks if a test of the survival function method is disabled.
-     *
-     * @return true if a survival function test is disabled.
-     * @see #getSfValues()
-     */
-    boolean isDisableSf() {
-        return disableSf;
-    }
 }
 
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/HypergeometricDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/HypergeometricDistributionTest.java
index b5c72c7..64c4ea8 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/HypergeometricDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/HypergeometricDistributionTest.java
@@ -227,7 +227,7 @@ class HypergeometricDistributionTest extends BaseDiscreteDistributionTest {
             HypergeometricDistribution.of(500, 70, 300),
             new int[] {10, 8},
             new double[] {2.4055720603264525e-17, 1.2848174992266236e-19},
-            createHighPrecisionTolerance());
+            DoubleTolerances.relative(5e-14));
     }
 
     @Test
@@ -237,6 +237,6 @@ class HypergeometricDistributionTest extends BaseDiscreteDistributionTest {
             HypergeometricDistribution.of(500, 70, 300),
             new int[] {68, 69},
             new double[] {4.570379934029859e-16, 7.4187180434325268e-18},
-            createHighPrecisionTolerance());
+            DoubleTolerances.relative(5e-14));
     }
 }
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NormalDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NormalDistributionTest.java
index bbfba7f..da769f4 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NormalDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/NormalDistributionTest.java
@@ -59,16 +59,6 @@ class NormalDistributionTest extends BaseContinuousDistributionTest {
         return 20 * RELATIVE_EPS;
     }
 
-    @Override
-    protected double getHighPrecisionRelativeTolerance() {
-        // Tests are limited by the survival probability.
-        // Tolerance is 1.6653345369377348E-14.
-        // This is the lowest achieved with various implementations of the
-        // survival function against high precision reference data.
-        // It requires computing the factor sqrt(2 * sd * sd) exactly.
-        return 75 * RELATIVE_EPS;
-    }
-
     //-------------------- Additional test cases -------------------------------
 
     @Test
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java
index f719f40..0988410 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/ParetoDistributionTest.java
@@ -84,7 +84,7 @@ class ParetoDistributionTest extends BaseContinuousDistributionTest {
             dist,
             new double[] {2.100000000000001, 2.100000000000005},
             new double[] {6.217248937900875e-16, 3.2640556923979585e-15},
-            createHighPrecisionTolerance());
+            DoubleTolerances.relative(5e-14));
     }
 
     @Test
@@ -94,7 +94,7 @@ class ParetoDistributionTest extends BaseContinuousDistributionTest {
             dist,
             new double[] {42e11, 64e11},
             new double[] {6.005622169907148e-18, 3.330082930386111e-18},
-            createHighPrecisionTolerance());
+            DoubleTolerances.relative(5e-14));
     }
 
     @Test
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/PoissonDistributionTest.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/PoissonDistributionTest.java
index 095de50..ed548b0 100644
--- a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/PoissonDistributionTest.java
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/PoissonDistributionTest.java
@@ -130,7 +130,7 @@ class PoissonDistributionTest extends BaseDiscreteDistributionTest {
                 PoissonDistribution.of(100),
                 new int[] {28, 25},
                 new double[] {1.6858675763053070496e-17, 3.184075559619425735e-19},
-                createHighPrecisionTolerance());
+                DoubleTolerances.relative(5e-14));
     }
 
     /**
diff --git a/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestName.java b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestName.java
new file mode 100644
index 0000000..7d71a8f
--- /dev/null
+++ b/commons-statistics-distribution/src/test/java/org/apache/commons/statistics/distribution/TestName.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.statistics.distribution;
+
+import java.util.Locale;
+
+/**
+ * Contains the names for the standard tests.
+ * These names are used as keys in the test resource properties files.
+ */
+enum TestName {
+    PDF,
+    LOGPDF,
+    PMF,
+    LOGPMF,
+    CDF,
+    SF,
+    CDF_HP,
+    SF_HP,
+    ICDF,
+    ISF,
+    CDF_MAPPING,
+    SF_MAPPING,
+    COMPLEMENT,
+    CONSISTENCY,
+    OUTSIDE_SUPPORT,
+    SAMPLING,
+    SAMPLING_PMF,
+    INTEGRALS,
+    SUPPORT,
+    MOMENTS,
+    MEDIAN,
+    PMF_SUM;
+
+    /** Cache the values for use in string conversion. */
+    private static final TestName[] VALUES = values();
+
+    /** The test name as a String. */
+    private final String name;
+
+    /**
+     * Create an instance.
+     */
+    TestName() {
+        name = this.name().toLowerCase(Locale.ROOT).replace('_', '.');
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+
+    /**
+     * Get the instance from the the String representation.
+     *
+     * @param key String representation.
+     * @return the instance (or null)
+     */
+    static TestName fromString(String key) {
+        for (final TestName v : VALUES) {
+            if (v.name.equals(key)) {
+                return v;
+            }
+        }
+        return null;
+    }
+}
+
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.2.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.2.properties
index 92bac80..af855fb 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.2.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.2.properties
@@ -30,3 +30,4 @@ pmf.values = 1.000000000000088817841970016428095E-200
 # computed using R version 3.4.4
 cdf.hp.points = 82, 81
 cdf.hp.values = 1.4061271955993513664e-17, 6.1128083336354843707e-19
+cdf.hp.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.3.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.3.properties
index 09cb32c..663d065 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.3.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.binomial.3.properties
@@ -28,3 +28,4 @@ pmf.values = 1.000000000000002081668171172170658E-200
 # computed using R version 3.4.4
 sf.hp.points = 18, 19
 sf.hp.values = 6.1128083336353977038e-19, 2.4944165604029235392e-20
+sf.hp.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.levy.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.levy.1.properties
index 0410f7e..2f7d37c 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.levy.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.levy.1.properties
@@ -47,6 +47,7 @@ logpdf.values = \
 # Computed using WolframAlpha
 cdf.hp.points = 1.205, 1.2049
 cdf.hp.values = 3.7440973842063723e-19, 1.6388396909072308e-19
+cdf.hp.relative = 5e-14
 sf.hp.points = 1e39, 42e37
 sf.hp.values = 1.5957691216057308e-20, 2.4623252122982907e-20
 # As cdf.values above but with the redundant 0 removed
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties
index 39424da..a16a2c9 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.normal.1.properties
@@ -64,6 +64,7 @@ sf.values = \
 # scipy:                       2.7412226346110703e-18  4.1045652533918685e-19
 cdf.hp.points = -10, -10.3
 cdf.hp.values = 2.74122263461107252124815886312e-18, 4.10456525339188007632261800065e-19
+cdf.hp.relative = 1e-14
 
 # E.g.
 # x = sym(14.5)
@@ -76,3 +77,4 @@ cdf.hp.values = 2.74122263461107252124815886312e-18, 4.1045652533918800763226180
 # scipy:                       4.1045652533918685e-19  1.7495528006975224e-17
 sf.hp.points = 14.5, 13.9
 sf.hp.values = 4.10456525339190342717686865166e-19, 1.74955280069751640746342569694e-17
+sf.hp.relative = 1e-14
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.10.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.10.properties
index 7882d53..333c239 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.10.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.10.properties
@@ -27,4 +27,4 @@ logpdf.values = -744.4400719213812 -744.5353821011855 -744.6223934781751 -Inf
 
 # The sampling test is not applicable as there are no quartiles.
 # As shape -> infinity then sampling will return the scale parameter.
-disable.sample = true
+sampling.disable = true
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.11.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.11.properties
index f22b078..c1b51e0 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.11.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.11.properties
@@ -27,4 +27,4 @@ logpdf.values = -742.1374868283872 -742.8306340089471 -743.2360991170552 -Inf
 
 # The sampling test is not applicable as there are no quartiles.
 # As shape -> infinity then sampling will return the scale parameter.
-disable.sample = true
+sampling.disable = true
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.5.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.5.properties
index f23e9b1..39fa152 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.5.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.5.properties
@@ -24,4 +24,4 @@ pdf.values = Inf 0 0
 
 # The sampling test is not applicable as there are no quartiles.
 # As shape -> infinity then sampling will return the scale parameter.
-disable.sample = true
+sampling.disable = true
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.6.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.6.properties
index 9f89f68..241e2ae 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.6.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.6.properties
@@ -24,4 +24,4 @@ pdf.values = Inf 0 0 0
 
 # The sampling test is not applicable as there are no quartiles.
 # As shape -> infinity then sampling will return the scale parameter.
-disable.sample = true
+sampling.disable = true
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.7.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.7.properties
index 24871e6..a0f0d7a 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.7.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.7.properties
@@ -24,4 +24,4 @@ pdf.values = Inf 0 0
 
 # The sampling test is not applicable as there are no quartiles.
 # As shape -> infinity then sampling will return the scale parameter.
-disable.sample = true
+sampling.disable = true
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.9.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.9.properties
index eb18228..d7bc7ca 100644
--- a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.9.properties
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.pareto.9.properties
@@ -27,4 +27,4 @@ logpdf.values = -746.7426570143753 -746.7526073452284 -746.7624596416714 -Inf
 
 # The sampling test is not applicable as there are no quartiles.
 # As 1 / shape -> infinity then sampling will return infinity.
-disable.sample = true
+sampling.disable = true