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
The following commit(s) were added to refs/heads/master by this push: new d52ecf3 Relax tolerance on DDTest for simplePow d52ecf3 is described below commit d52ecf3a1d106282629984fbb6ef28afa2a5bb64 Author: Alex Herbert <aherb...@apache.org> AuthorDate: Sun Mar 12 21:39:03 2023 +0000 Relax tolerance on DDTest for simplePow --- .../java/org/apache/commons/statistics/inference/DDTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/commons-statistics-inference/src/test/java/org/apache/commons/statistics/inference/DDTest.java b/commons-statistics-inference/src/test/java/org/apache/commons/statistics/inference/DDTest.java index b3394bb..0e221ff 100644 --- a/commons-statistics-inference/src/test/java/org/apache/commons/statistics/inference/DDTest.java +++ b/commons-statistics-inference/src/test/java/org/apache/commons/statistics/inference/DDTest.java @@ -1366,8 +1366,8 @@ class DDTest { DD.fastTwoSum(x, xx, s); final int n = rng.nextInt(2400, 2500); // Math.log(16.0 * (2499) * 0x1.0p-106) / Math.log(2) = -90.7 - builder.add(Arguments.of(s.hi(), s.lo(), n, 0x1.0p-52, 0x1.0p-93)); - builder.add(Arguments.of(s.hi(), s.lo(), -n, 0x1.0p-52, 0x1.0p-93)); + builder.add(Arguments.of(s.hi(), s.lo(), n, 0x1.0p-51, 0x1.0p-93)); + builder.add(Arguments.of(s.hi(), s.lo(), -n, 0x1.0p-51, 0x1.0p-93)); } // Powers where the fractional representation overflow/underflow @@ -1464,6 +1464,11 @@ class DDTest { builder.add(Arguments.of(0.5014627401015759, 4.9149107900633496E-17, 2424, 0x1.0p-52, 0x1.0p-93)); builder.add(Arguments.of(0.5014627401015759, 4.9149107900633496E-17, -2424, 0x1.0p-52, 0x1.0p-93)); + // Observed to fail simplePow at 2^-52 (requires ~ 1.01 * 2^-52) + // This is platform dependent due to the use of java.lang.Math functions. + builder.add(Arguments.of(0.7409802960884472, -2.4773863758919158E-17, 2416, 0x1.0p-51, 0x1.0p-93)); + builder.add(Arguments.of(0.7409802960884472, -2.4773863758919158E-17, -2416, 0x1.0p-51, 0x1.0p-93)); + return builder.build(); }