diff options
Diffstat (limited to 'libc/test/src/math/cos_test.cpp')
-rw-r--r-- | libc/test/src/math/cos_test.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libc/test/src/math/cos_test.cpp b/libc/test/src/math/cos_test.cpp index e2d4791..40c43f9 100644 --- a/libc/test/src/math/cos_test.cpp +++ b/libc/test/src/math/cos_test.cpp @@ -7,11 +7,18 @@ //===----------------------------------------------------------------------===// #include "src/__support/FPUtil/FPBits.h" +#include "src/__support/macros/optimization.h" #include "src/math/cos.h" #include "test/UnitTest/FPMatcher.h" #include "test/UnitTest/Test.h" #include "utils/MPFRWrapper/MPFRUtils.h" +#ifdef LIBC_MATH_HAS_SKIP_ACCURATE_PASS +#define TOLERANCE 1 +#else +#define TOLERANCE 0 +#endif // LIBC_MATH_HAS_SKIP_ACCURATE_PASS + using LlvmLibcCosTest = LIBC_NAMESPACE::testing::FPTest<double>; namespace mpfr = LIBC_NAMESPACE::testing::mpfr; @@ -57,7 +64,7 @@ TEST_F(LlvmLibcCosTest, TrickyInputs) { for (int i = 0; i < N; ++i) { double x = INPUTS[i]; ASSERT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Cos, x, - LIBC_NAMESPACE::cos(x), 0.5); + LIBC_NAMESPACE::cos(x), TOLERANCE + 0.5); } } |