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 9b51d4c  Lower test tolerance
9b51d4c is described below

commit 9b51d4c3785289f1b8ba3cac0229dd23040d081b
Author: aherbert <aherb...@apache.org>
AuthorDate: Wed May 1 18:25:36 2024 +0100

    Lower test tolerance
    
    Added sporadic failure case for a product of int/long values.
---
 .../org/apache/commons/statistics/descriptive/IntProductTest.java  | 7 ++++++-
 .../org/apache/commons/statistics/descriptive/LongProductTest.java | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/IntProductTest.java
 
b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/IntProductTest.java
index 580117e..e04ab7d 100644
--- 
a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/IntProductTest.java
+++ 
b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/IntProductTest.java
@@ -60,7 +60,7 @@ final class IntProductTest extends 
BaseIntStatisticTest<DoubleAsIntStatistic> {
 
     @Override
     protected DoubleTolerance getTolerance() {
-        return DoubleTolerances.ulps(10);
+        return DoubleTolerances.ulps(20);
     }
 
     @Override
@@ -70,6 +70,11 @@ final class IntProductTest extends 
BaseIntStatisticTest<DoubleAsIntStatistic> {
         // Python Numpy v1.25.1: numpy.product
         builder.accept(addReference(24.0, DoubleTolerances.ulps(1), 1, 2, 3, 
4));
         builder.accept(addReference(3081078000.0, DoubleTolerances.ulps(1), 5, 
9, 13, 14, 10, 12, 11, 15, 19));
+        // Case with ULP error of 11 and at least 17 observed with random 
permutation
+        builder.accept(addCase(43, 40, 42, 41, 42, 35, 38, 39, 47, 38, 44, 51, 
38, 45, 58, 45, 46, 49, 55, 49, 47, 43,
+            45, 46, 43, 46, 42, 41, 51, 44, 45, 44, 49, 48, 50, 51, 52, 53, 
50, 56, 55, 52, 42, 45, 48, 49, 51, 49, 47,
+            50, 44, 59, 40, 43, 38, 46, 39, 46, 36, 41, 46, 48, 50, 42, 51, 
70, 49, 43, 35, 43, 48, 52, 63, 45, 53, 39,
+            52, 45, 41, 43, 49, 42, 32, 47, 37, 46, 35, 42, 47, 42, 57, 45, 
55, 51, 40, 43, 45, 46, 53, 49));
         return builder.build();
     }
 }
diff --git 
a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/LongProductTest.java
 
b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/LongProductTest.java
index f126642..15793c6 100644
--- 
a/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/LongProductTest.java
+++ 
b/commons-statistics-descriptive/src/test/java/org/apache/commons/statistics/descriptive/LongProductTest.java
@@ -60,7 +60,7 @@ final class LongProductTest extends 
BaseLongStatisticTest<DoubleAsLongStatistic>
 
     @Override
     protected DoubleTolerance getTolerance() {
-        return DoubleTolerances.ulps(10);
+        return DoubleTolerances.ulps(20);
     }
 
     @Override
@@ -70,6 +70,11 @@ final class LongProductTest extends 
BaseLongStatisticTest<DoubleAsLongStatistic>
         // Python Numpy v1.25.1: numpy.product
         builder.accept(addReference(24.0, DoubleTolerances.ulps(1), 1, 2, 3, 
4));
         builder.accept(addReference(3081078000.0, DoubleTolerances.ulps(1), 5, 
9, 13, 14, 10, 12, 11, 15, 19));
+        // Case with ULP error of 11 and at least 17 observed with random 
permutation
+        builder.accept(addCase(43, 40, 42, 41, 42, 35, 38, 39, 47, 38, 44, 51, 
38, 45, 58, 45, 46, 49, 55, 49, 47, 43,
+            45, 46, 43, 46, 42, 41, 51, 44, 45, 44, 49, 48, 50, 51, 52, 53, 
50, 56, 55, 52, 42, 45, 48, 49, 51, 49, 47,
+            50, 44, 59, 40, 43, 38, 46, 39, 46, 36, 41, 46, 48, 50, 42, 51, 
70, 49, 43, 35, 43, 48, 52, 63, 45, 53, 39,
+            52, 45, 41, 43, 49, 42, 32, 47, 37, 46, 35, 42, 47, 42, 57, 45, 
55, 51, 40, 43, 45, 46, 53, 49));
         return builder.build();
     }
 }

Reply via email to