Skip to content

Conversation

@SwayamInSync
Copy link
Member

Copilot Summary

This pull request adds support for the hypot (Euclidean norm) operation to the quad-precision NumPy extension, including both implementation and comprehensive tests. The changes ensure that the hypot function is available for quad-precision and long double types, is registered as a universal function (ufunc), and is tracked in the release documentation.

Quad-precision and long double hypot implementation

  • Added the quad_hypot and ld_hypot functions to ops.hpp, providing quad-precision and long double implementations of the hypot operation using Sleef_hypotq1_u05 and the standard library hypotl, respectively. [1] [2]

Ufunc registration

  • Registered the new hypot operation as a binary ufunc in umath/binary_ops.cpp, making it available to users via NumPy.

Release tracking

  • Updated release_tracker.md to mark hypot as implemented and tested, ensuring the documentation reflects the new functionality. [1] [2]

Testing

  • Added a comprehensive parameterized test for the hypot ufunc in test_quaddtype.py, covering basic cases, symmetry, zero, negative values, infinities, and NaNs to ensure correctness and robustness.

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.

LGTM, with the tracker fixed

@SwayamInSync
Copy link
Member Author

Lets merge it in!

@SwayamInSync SwayamInSync merged commit 0f1e4a6 into numpy:main Oct 17, 2025
9 checks passed
@SwayamInSync SwayamInSync deleted the hypot branch October 17, 2025 15:54
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