Skip to content

Conversation

@RalfJung
Copy link
Member

@RalfJung RalfJung commented Nov 4, 2025

@eduardosm either something is wrong with the rsqrt implementation, or with the test... when run with many seeds, it fails saying

correct result: 0.5, got: 0.49987793
that's an error of -0.00024414063 = 2^-11.999999

@rustbot
Copy link
Collaborator

rustbot commented Nov 4, 2025

Thank you for contributing to Miri!
Please remember to not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it.

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Nov 4, 2025
@eduardosm
Copy link
Contributor

The relative error is exactly 2^-12, but calculating the log2 introduces some error, I believe that due to Miri introducing non-determinism to math functions. I think we should compare the relative error against 1.0/4096.0 and only use the log value in the assert message.

@RalfJung
Copy link
Member Author

RalfJung commented Nov 4, 2025

but calculating the log2 introduces some error,

🤦 of course. Thanks!

@RalfJung RalfJung enabled auto-merge November 4, 2025 20:24
@RalfJung RalfJung added this pull request to the merge queue Nov 4, 2025
Merged via the queue into rust-lang:master with commit de2a63b Nov 4, 2025
13 checks passed
@RalfJung RalfJung deleted the rounding-error branch November 4, 2025 21:27
@rustbot rustbot removed the S-waiting-on-review Status: Waiting for a review to complete label Nov 4, 2025
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.

3 participants