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

dirichlet_stability test fails on FreeBSD when compiled with cg_clif #1355

Open
bjorn3 opened this issue Nov 24, 2023 · 2 comments
Open

dirichlet_stability test fails on FreeBSD when compiled with cg_clif #1355

bjorn3 opened this issue Nov 24, 2023 · 2 comments

Comments

@bjorn3
Copy link
Contributor

bjorn3 commented Nov 24, 2023

cg_clif uses libm functions for most non-trivial float operations rather than x86 SSE instructions. I suspect there is a (1ULP?) inaccuracy in FreeBSD's libm implementation. In the past the same kind of error happened with MinGW, but that seems to have fixed itself at one point.

---- dirichlet_stability stdout ----
---- dirichlet_stability stderr ----
thread 'main' panicked at rand_distr/tests/value_stability.rs:362:5:
assertion `left == right` failed
  left: [0.0002758045685569205, 2.296135759821706e-20, 3.004118281150937e-9, 0.9997241924273248]
 right: [0.00027580456855692104, 2.296135759821706e-20, 3.004118281150937e-9, 0.9997241924273248]
@vks
Copy link
Collaborator

vks commented Nov 27, 2023

I'm not sure how we can fix this. Should we relax the test to accept 1 ULP of difference? Should we report this to FreeBSD upstream?

@bjorn3
Copy link
Contributor Author

bjorn3 commented Nov 28, 2023

Some float operations have a lower accuracy requirement (eg 1ULP) rather than the 1/2ULP accuracy requirement that basic math operations have. I don't know which operations have that though, but if dirichlet_stability uses one of these, FreeBSD is allowed to return this result and thus the test should be relaxed.

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

2 participants