Skip to content

Commit

Permalink
xsimd: reduce precision to fix asin test (NixOS#354908)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilazy committed Nov 18, 2024
2 parents 5321b54 + 37e9949 commit 57bd96c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkgs/by-name/xs/xsimd/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ stdenv.mkDerivation (finalAttrs: {
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
# https://github.com/xtensor-stack/xsimd/issues/1030
./disable-test_error_gamma.patch

# https://github.com/xtensor-stack/xsimd/issues/1063
./relax-asin-precision.diff
];

# strictDeps raises the chance that xsimd will be able to be cross compiled
Expand Down
14 changes: 14 additions & 0 deletions pkgs/by-name/xs/xsimd/relax-asin-precision.diff
Original file line number Diff line number Diff line change
@@ -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()
{

0 comments on commit 57bd96c

Please sign in to comment.