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

CHECK_EQ( extract(xsimd::polar(T(val0), T(val1))), std::polar(val0, val1) ) is NOT correct! #956

Closed
jcurtis-cc opened this issue Oct 16, 2023 · 3 comments

Comments

@jcurtis-cc
Copy link

Apple Silicon M1

[doctest] doctest version is "2.4.9"
[doctest] run with "--help" for options
===============================================================================
xsimd/test/test_xsimd_api.cpp:747:
TEST CASE: [xsimd api | float types functions]<xsimd::batch>
polar

xsimd/test/test_xsimd_api.cpp:669: ERROR: CHECK_EQ( extract(xsimd::polar(T(val0), T(val1))), std::polar(val0, val1) ) is NOT correct!
values: CHECK_EQ( (-1.96093,-2.27041), (-1.96093,-2.27041) )

===============================================================================
[doctest] test cases: 308 | 307 passed | 1 failed | 0 skipped
[doctest] assertions: 8191 | 8190 passed | 1 failed |
[doctest] Status: FAILURE

@serge-sans-paille
Copy link
Contributor

How strange... The polar function is generic and relies on sincos, which itself is generic and tested on all other architectures :-/
I don't have an hint there, we could relax the check?

@JohanMabille
Copy link
Member

JohanMabille commented Oct 17, 2023

We had the same issue with emscripten, using an alternative implementation fixed the issue.

It is less efficient, but more accurate (although I'm not sure to understand why, sincos(a) should give the same results as (sin(a), cos(a)).

@serge-sans-paille
Copy link
Contributor

Fixed by #970

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

3 participants