BUG: Loss of precision in longdouble min#20872
Merged
seberg merged 3 commits intonumpy:mainfrom Feb 1, 2022
Merged
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`
This was referenced Jan 21, 2022
Member
|
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
Contributor
Author
|
We've added some tests based on the comments in #20863 |
seberg
approved these changes
Jan 31, 2022
Member
seberg
left a comment
There was a problem hiding this comment.
Thanks. Could be nice to parametrize this more, but the whole file doesn't parametrize much, so it seems OK.
melissawm
pushed a commit
to melissawm/numpy
that referenced
this pull request
Apr 12, 2022
* 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 <[email protected]>
seberg
added a commit
to seberg/numpy
that referenced
this pull request
Apr 24, 2022
* 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 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generic reuse in the latest changes around
minworks unless the macro is redefined for SIMD.This change avoids
scalar_min_ffor generic comparisons (as it can be redefined) and defines is separately asscalar_minThis should resolve #20863