diff options
| author | Florian Mayer <fmayer@google.com> | 2025-10-22 10:55:10 -0700 |
|---|---|---|
| committer | Florian Mayer <fmayer@google.com> | 2025-10-22 10:55:10 -0700 |
| commit | f5f8398d7fe18a968f5873518e87d5fdd8269359 (patch) | |
| tree | 347dff286c3b48b2336fb7a425adfceebd478116 /libc/test/src/math/log1pf_test.cpp | |
| parent | 73edaec4a6cd1212f9ae819c413d2cf58216d3b1 (diff) | |
| parent | a0abc0af0a0a90878822f8107d70dad6f7cdfc26 (diff) | |
Created using spr 1.3.7
Diffstat (limited to 'libc/test/src/math/log1pf_test.cpp')
| -rw-r--r-- | libc/test/src/math/log1pf_test.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libc/test/src/math/log1pf_test.cpp b/libc/test/src/math/log1pf_test.cpp index 2df452629b98..ef61f5ae41b1 100644 --- a/libc/test/src/math/log1pf_test.cpp +++ b/libc/test/src/math/log1pf_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/log1pf.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 LlvmLibcLog1pfTest = LIBC_NAMESPACE::testing::FPTest<float>; @@ -63,7 +69,7 @@ TEST_F(LlvmLibcLog1pfTest, TrickyInputs) { for (int i = 0; i < N; ++i) { float x = FPBits(INPUTS[i]).get_val(); EXPECT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Log1p, x, - LIBC_NAMESPACE::log1pf(x), 0.5); + LIBC_NAMESPACE::log1pf(x), TOLERANCE + 0.5); } } |
