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

A test that uses Boost multiprecision to validate the platform libraries #3967

Merged
merged 10 commits into from
Apr 7, 2024

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Apr 7, 2024

Comment on lines +32 to +40
max_sin_ulp_distance =
std::max(max_sin_ulp_distance,
ULPDistance(std::sin(α), static_cast<double>(Sin(α))));
max_cos_ulp_distance =
std::max(max_cos_ulp_distance,
ULPDistance(std::cos(α), static_cast<double>(Cos(α))));
}
EXPECT_EQ(1, max_sin_ulp_distance);
EXPECT_EQ(1, max_cos_ulp_distance);
Copy link
Member

Choose a reason for hiding this comment

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

This tells us that it sometimes misrounds, but it does not tell us that it is faithful, nor how much it misrounds. In a subsequent PR it would be nice to compute the distance between Sin(α) and std::sin(α) in (fractional) ULPs of static_cast<double>(Sin(α)).

@eggrobin eggrobin added the LGTM label Apr 7, 2024
@pleroy pleroy merged commit 30d6b42 into mockingbirdnest:master Apr 7, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants