-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the pow1p
function
#1183
base: develop
Are you sure you want to change the base?
Add the pow1p
function
#1183
Conversation
It’s really cool to have this in boost! Thanks a ton! There is some refinement I’m looking to apply: (1) represent the result of I’m going to work out the proof on paper first, and then suggest the changes here. Another optimization that could be applied is that if a floating point type is available whose mantissa has more bits than the total bits of Finally, I’m going to prepare some edge input as test cases, to complement your randomized test cases, which I find really helpful! P.S. The (floating point) exception signaling (via the policy object) might have some corner cases to refine, but I’d leave that after the computational part is finalized. Thanks again for bring this into boost!! |
I made an update to the algorithm (in the referenced PR) that makes the evaluation more accurate for tiny I think the method is now accurate to a few epsilon relative error for all @mborland If you could update line 193-219 of |
Co-authored-by: fancidev <[email protected]>
Changes have been applied. Edit: @fancidev as you work on test cases it looks like right now I am not hitting anything in your double-T range with the random values. If you could come up with cases to exercise those it would be helpful. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1183 +/- ##
===========================================
- Coverage 94.08% 94.06% -0.03%
===========================================
Files 780 782 +2
Lines 65815 65916 +101
===========================================
+ Hits 61922 62003 +81
- Misses 3893 3913 +20
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
This implements the
pow1p
function as discussed and implemented in scipy/scipy#21404 and scipy/scipy#21410. Simplifies a couple of the branches and adds in policy based design for the error paths. This version is also tested withreal_concept
and on the GPU platforms (NVCC, NVRTC, and SYCL).@fancidev let me know if you see any errors in simplification. The one to call out is here: https://github.com/boostorg/math/compare/pow1p?expand=1#diff-1a6b6446fd424370a1fe6e67b8166e41ab4805c1ecfc4ca15ceae7492f4023a5R137. I fall back to
pow
instead of throwing on non-integer power.@NAThompson and @jzmaddock your review would be appreciated as always.
CC: @WarrenWeckesser