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

Fix Hafnian accuracy issue #98

Merged
merged 3 commits into from Mar 11, 2023
Merged

Fix Hafnian accuracy issue #98

merged 3 commits into from Mar 11, 2023

Conversation

GregoryMorse
Copy link
Contributor

No description provided.

Copy link
Contributor

@Kolarovszki Kolarovszki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me. In conclusion, the problem was that sqrt operated with doubles instead of long doubles, right?

@rakytap rakytap merged commit 6ff154d into main Mar 11, 2023
@GregoryMorse
Copy link
Contributor Author

Yes exactly, the pure double and pure long double modes were new. But for proper accuracy comparison to the other library, we needed the long double implementation completely proper. And for some reason gcc seems not to be standards compliant.

sqrt(long double) and sqrt(double) should simply work in fact according to: https://en.cppreference.com/w/cpp/numeric/math/sqrt

Perhaps in more current gcc versions this library issue is fixed, as it has been reported, as its much broader, we previously ran into it with integer rounding with rint vs lrint and such.

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

Successfully merging this pull request may close these issues.

None yet

3 participants