From 0519bcf8c6460a707119b3ad2b0142b6f71c963e Mon Sep 17 00:00:00 2001 From: Erik Lindahl Date: Fri, 13 Sep 2019 22:43:05 +0200 Subject: [PATCH] Add rounding correction to unsafe simd exp tests too This was already present for the safe-version tests, but when modifying the test limits of the unsafe version we need it there too to fix the ARMv7 tests. Change-Id: I4dbab9655a9405bb17a8007a065aea3f4b991ed5 --- src/gromacs/simd/tests/simd_math.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gromacs/simd/tests/simd_math.cpp b/src/gromacs/simd/tests/simd_math.cpp index 425d22897b..959009013a 100644 --- a/src/gromacs/simd/tests/simd_math.cpp +++ b/src/gromacs/simd/tests/simd_math.cpp @@ -771,7 +771,7 @@ TEST_F(SimdMathTest, exp) TEST_F(SimdMathTest, expUnsafe) { // See test of exp() for comments about test ranges - const real lowestRealThatProducesNormal = (std::numeric_limits::min_exponent - 1)*std::log(2.0); + const real lowestRealThatProducesNormal = (std::numeric_limits::min_exponent - 1)*std::log(2.0)*(1-std::numeric_limits::epsilon()); const real highestRealThatProducesNormal = (std::numeric_limits::max_exponent - 1)*std::log(2.0); CompareSettings settings { @@ -1256,7 +1256,7 @@ TEST_F(SimdMathTest, expSingleAccuracy) TEST_F(SimdMathTest, expSingleAccuracyUnsafe) { // See test of exp() for comments about test ranges - const real lowestRealThatProducesNormal = (std::numeric_limits::min_exponent - 1)*std::log(2.0); + const real lowestRealThatProducesNormal = (std::numeric_limits::min_exponent - 1)*std::log(2.0)*(1-std::numeric_limits::epsilon()); const real highestRealThatProducesNormal = (std::numeric_limits::max_exponent - 1)*std::log(2.0); // Increase the allowed error by the difference between the actual precision and single -- 2.11.4.GIT