asin
test fails on darwin x86 & aarch64 with clang-19
#1063
Open
Description
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()
+ {
Metadata
Assignees
Labels
No labels