Skip to content

Conversation

@SwayamInSync
Copy link
Member

Copilot Summary

This pull request adds support for the cube root (cbrt) function to the quad-precision type, including its implementation, integration with NumPy ufuncs, release documentation, and comprehensive tests to ensure correctness and accuracy. The changes ensure that np.cbrt works seamlessly for quad-precision numbers, handling edge cases and special values.

Quad-precision cube root (cbrt) support:

  • Implemented the quad_cbrt function in ops.hpp, handling special cases (NaN, zero, infinity, negative values) and computing the cube root using quad-precision arithmetic.
  • Added the ld_cbrt function for long double cube root support in ops.hpp.

NumPy integration:

  • Registered the new cbrt ufunc for both quad and long double types in umath/unary_ops.cpp, enabling its use via np.cbrt.

Documentation and release tracking:

  • Updated release_tracker.md to indicate that cbrt is now supported for both quad and long double types.

Testing and validation:

  • Added comprehensive tests for cbrt in test_quaddtype.py, covering perfect cubes, edge cases, special values, and accuracy checks for both positive and negative inputs.

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

@SwayamInSync
Copy link
Member Author

merging this in!

@SwayamInSync SwayamInSync merged commit ae618c9 into numpy:main Oct 17, 2025
9 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