aboutsummaryrefslogtreecommitdiff
path: root/libc/test/src/math/expm1_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/test/src/math/expm1_test.cpp')
-rw-r--r--libc/test/src/math/expm1_test.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libc/test/src/math/expm1_test.cpp b/libc/test/src/math/expm1_test.cpp
index c185be9..8ca9b77 100644
--- a/libc/test/src/math/expm1_test.cpp
+++ b/libc/test/src/math/expm1_test.cpp
@@ -7,13 +7,19 @@
//===----------------------------------------------------------------------===//
#include "hdr/math_macros.h"
+#include "hdr/stdint_proxy.h"
#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/optimization.h"
#include "src/math/expm1.h"
#include "test/UnitTest/FPMatcher.h"
#include "test/UnitTest/Test.h"
#include "utils/MPFRWrapper/MPFRUtils.h"
-#include "hdr/stdint_proxy.h"
+#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS
+#define TOLERANCE 1
+#else
+#define TOLERANCE 0
+#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS
using LlvmLibcExpm1Test = LIBC_NAMESPACE::testing::FPTest<double>;
@@ -36,9 +42,9 @@ TEST_F(LlvmLibcExpm1Test, TrickyInputs) {
for (int i = 0; i < N; ++i) {
double x = INPUTS[i];
EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Expm1, x,
- LIBC_NAMESPACE::expm1(x), 0.5);
+ LIBC_NAMESPACE::expm1(x), TOLERANCE + 0.5);
EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Expm1, -x,
- LIBC_NAMESPACE::expm1(-x), 0.5);
+ LIBC_NAMESPACE::expm1(-x), TOLERANCE + 0.5);
}
}