Skip to content

Conversation

SwayamInSync
Copy link
Member

Copilot Summary

This pull request adds full support for the logaddexp2 operation in quad-precision and long double types, including its implementation, exposure as a NumPy ufunc, and comprehensive tests for correctness and special cases. The release tracker is also updated to reflect this new support.

Implementation of logaddexp2 operation:

  • Added a numerically stable implementation of quad_logaddexp2 for quad-precision (Sleef_quad) and ld_logaddexp2 for long double, handling all special cases (NaN, infinities, etc.). (quaddtype/numpy_quaddtype/src/ops.hpp) [1]], [2]])

Integration with NumPy:

Testing improvements:

  • Added comprehensive parameterized tests for logaddexp2, covering a wide range of values (including edge cases like NaN and infinities), mathematical properties, and its relationship to logaddexp. (quaddtype/tests/test_quaddtype.py) ([quaddtype/tests/test_quaddtype.pyR531-R637])

Documentation and tracking:

  • Updated the release tracker to indicate that logaddexp2 is now fully supported for both quad and long double types. (quaddtype/release_tracker.md) ([quaddtype/release_tracker.mdL14-R14])

Copy link
Contributor

@juntyr juntyr left a comment

Choose a reason for hiding this comment

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

LGMT

@SwayamInSync
Copy link
Member Author

Since true_divide ufunc uses the ufunc divide <ufunc 'divide'> which is already registered so just adding its test cases here

@SwayamInSync
Copy link
Member Author

Lets take this in, maybe job-14 got stuck

@SwayamInSync SwayamInSync merged commit 87cc9ba into numpy:main Oct 16, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants