From 5ac663447c962a368eba00dc89e1c4bf67ef2128 Mon Sep 17 00:00:00 2001 From: Alex Herbert Date: Thu, 14 Nov 2024 14:36:47 +0000 Subject: [PATCH] Update to Commons Numbers implementation of reference Erf function --- .../test/java/uk/ac/sussex/gdsc/core/utils/MathUtilsTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdsc-core/src/test/java/uk/ac/sussex/gdsc/core/utils/MathUtilsTest.java b/gdsc-core/src/test/java/uk/ac/sussex/gdsc/core/utils/MathUtilsTest.java index 520f8d1e..0bf69e82 100644 --- a/gdsc-core/src/test/java/uk/ac/sussex/gdsc/core/utils/MathUtilsTest.java +++ b/gdsc-core/src/test/java/uk/ac/sussex/gdsc/core/utils/MathUtilsTest.java @@ -31,8 +31,8 @@ import java.math.BigDecimal; import java.math.MathContext; import java.util.function.DoubleUnaryOperator; -import org.apache.commons.math3.special.Erf; import org.apache.commons.numbers.core.Sum; +import org.apache.commons.numbers.gamma.Erf; import org.apache.commons.rng.UniformRandomProvider; import org.apache.commons.statistics.descriptive.Mean; import org.junit.jupiter.api.Assertions; @@ -848,7 +848,7 @@ void testErf(RandomSeed seed) { for (int i = 0; i < 10; i++) { final double x = r.nextDouble(); for (int j = 1; j <= 5; j++) { - Assertions.assertEquals(Erf.erf(x * j), MathUtils.erf(x * j), 1e-6); + Assertions.assertEquals(Erf.value(x * j), MathUtils.erf(x * j), 1e-6); } } }