Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@antareepsarkar
Copy link

Description

This adds binary exponentiation to the _pow function in 'numpy/polynomial/polyutils.py'

Motivation

To optimize exponentiation

@antareepsarkar antareepsarkar reopened this Nov 5, 2025
@jorenham jorenham changed the title add binary exponentiation in _pow ENH: add binary exponentiation in polynomial.polyutils._pow Nov 5, 2025
@antareepsarkar
Copy link
Author

antareepsarkar commented Nov 5, 2025

I think the checks failed due to decimal value related issues i.e. rounding off, etc.

@mattip
Copy link
Member

mattip commented Nov 5, 2025

Once tests are passing, this needs benchmarks to prove it is actually an improvement

@antareepsarkar
Copy link
Author

antareepsarkar commented Nov 6, 2025

Once tests are passing, this needs benchmarks to prove it is actually an improvement

Probably, the tests are failing due to how decimal values are handled by Python(e.g.: 0.33333333333333333*3 is 1.0 in Python).
The expected values and the actual values in the errors are different at the decimal places because the order in which the terms are being multiplied can matter in the case of decimal values.

Please look into this.

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.

3 participants