Skip to content

Complex::sqrt() does not produce cross-system reproducible results #139

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

Open
Muon opened this issue Mar 25, 2025 · 2 comments
Open

Complex::sqrt() does not produce cross-system reproducible results #139

Muon opened this issue Mar 25, 2025 · 2 comments

Comments

@Muon
Copy link

Muon commented Mar 25, 2025

In the current implementation, computing the argument of a complex number depends on the system math library's implementation of atan2, which is not guaranteed to produce exactly rounded (or otherwise portably reproducible) results. However, the principal complex square root can be computed using only the usual correctly rounded operations (+, -, *, /, sqrt), which are reproducible on all IEEE 754 systems.

@Muon Muon changed the title Complex::sqrt() does not produce cross-sytem reproducible results Complex::sqrt() does not produce cross-system reproducible results Mar 25, 2025
@cuviper
Copy link
Member

cuviper commented Mar 25, 2025

Would #129 address that sufficiently? If not, do you have a problematic example?

@Muon
Copy link
Author

Muon commented Mar 25, 2025

Yes, that should work perfectly! Sorry, missed it when I was searching.

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