Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asin test fails on darwin x86 & aarch64 with clang-19 #1063

Open
paparodeo opened this issue Nov 10, 2024 · 0 comments
Open

asin test fails on darwin x86 & aarch64 with clang-19 #1063

paparodeo opened this issue Nov 10, 2024 · 0 comments

Comments

@paparodeo
Copy link

asin test fails on darwin x86 & aarch64 with clang-19

[doctest] doctest version is "2.4.11"
[doctest] run with "--help" for options
===============================================================================
/tmp/nix-build-xsimd-13.0.0.drv-0/source/test/test_xsimd_api.cpp:755:
TEST CASE:  [xsimd api | float types functions]<xsimd::batch<float>>
  asin

/tmp/nix-build-xsimd-13.0.0.drv-0/source/test/test_xsimd_api.cpp:471: ERROR: CHECK_EQ( extract(xsimd::asin(T(val))), std::asin(val) ) is NOT correct!
  values: CHECK_EQ( 1.5708, 1.5708 )

===============================================================================
[doctest] test cases:  320 |  319 passed | 1 failed | 0 skipped
[doctest] assertions: 8285 | 8284 passed | 1 failed |
[doctest] Status: FAILURE!

reducing the precision fixes the test

diff --git a/pkgs/by-name/xs/xsimd/relax-asin-precision.diff b/pkgs/by-name/xs/xsimd/relax-asin-precision.diff
new file mode 100644
index 000000000000..7623f6e81e4a
--- /dev/null
+++ b/pkgs/by-name/xs/xsimd/relax-asin-precision.diff
@@ -0,0 +1,14 @@
+diff --git a/test/test_xsimd_api.cpp b/test/test_xsimd_api.cpp
+index f416ae9..1f8253e 100644
+--- a/test/test_xsimd_api.cpp
++++ b/test/test_xsimd_api.cpp
+@@ -468,7 +468,8 @@ struct xsimd_api_float_types_functions
+     void test_asin()
+     {
+         value_type val(1);
+-        CHECK_EQ(extract(xsimd::asin(T(val))), std::asin(val));
++        CHECK(extract(xsimd::asin(T(val)))
++              == doctest::Approx(std::asin(val)).epsilon(1e-7));
+     }
+     void test_asinh()
+     {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant