-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG: Loss of precision in longdouble min #20872
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
BUG: Loss of precision in longdouble min #20872
Conversation
Generic reuse in the latest changes around `min` works unless the macro is redefined for SIMD. This change avoids `scalar_min_f` for generic comparisons (as it can be redefined) and defines is separately as `scalar_min`
Thanks! Could you add a test that confirms full precision is preserved here? It would also be nice to "fuzz" it a bit around stranger cases (maybe array size and inclusion of We really need to have a tests that are capable of catching this type of precision loss. |
Adding tests like suggested in numpy#20863
We've added some tests based on the comments in #20863 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Could be nice to parametrize this more, but the whole file doesn't parametrize much, so it seems OK.
* BUG: Loss of precision in longdouble min Generic reuse in the latest changes around `min` works unless the macro is redefined for SIMD. This change avoids `scalar_min_f` for generic comparisons (as it can be redefined) and defines is separately as `scalar_min` * Add tests as requested Adding tests like suggested in numpy#20863 * MAINT: Use `np.longdouble` rather than float128 for min/max tests Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* BUG: Loss of precision in longdouble min Generic reuse in the latest changes around `min` works unless the macro is redefined for SIMD. This change avoids `scalar_min_f` for generic comparisons (as it can be redefined) and defines is separately as `scalar_min` * Add tests as requested Adding tests like suggested in numpy#20863 * MAINT: Use `np.longdouble` rather than float128 for min/max tests Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Generic reuse in the latest changes around
min
works unless the macro is redefined for SIMD.This change avoids
scalar_min_f
for generic comparisons (as it can be redefined) and defines is separately asscalar_min
This should resolve #20863