diff options
Diffstat (limited to 'libc/test/src/math/coshf16_test.cpp')
-rw-r--r-- | libc/test/src/math/coshf16_test.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libc/test/src/math/coshf16_test.cpp b/libc/test/src/math/coshf16_test.cpp index a0d1fd2..8e8f55e 100644 --- a/libc/test/src/math/coshf16_test.cpp +++ b/libc/test/src/math/coshf16_test.cpp @@ -6,11 +6,18 @@ // //===----------------------------------------------------------------------===// +#include "src/__support/macros/optimization.h" #include "src/math/coshf16.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 LlvmLibcCoshf16Test = LIBC_NAMESPACE::testing::FPTest<float16>; namespace mpfr = LIBC_NAMESPACE::testing::mpfr; @@ -27,7 +34,7 @@ TEST_F(LlvmLibcCoshf16Test, PositiveRange) { for (uint16_t v = POS_START; v <= POS_STOP; ++v) { float16 x = FPBits(v).get_val(); EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Cosh, x, - LIBC_NAMESPACE::coshf16(x), 0.5); + LIBC_NAMESPACE::coshf16(x), TOLERANCE + 0.5); } } @@ -35,6 +42,6 @@ TEST_F(LlvmLibcCoshf16Test, NegativeRange) { for (uint16_t v = NEG_START; v <= NEG_STOP; ++v) { float16 x = FPBits(v).get_val(); EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Cosh, x, - LIBC_NAMESPACE::coshf16(x), 0.5); + LIBC_NAMESPACE::coshf16(x), TOLERANCE + 0.5); } } |