Skip to content
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

Increase the accuracy of "exp" and "exp2" #32

Closed
PaulRBerg opened this issue May 18, 2021 · 2 comments
Closed

Increase the accuracy of "exp" and "exp2" #32

PaulRBerg opened this issue May 18, 2021 · 2 comments

Comments

@PaulRBerg
Copy link
Owner

Say you want to calculate e^88.722839111672999627. According to WolframAlpha, this is the correct answer:

340282366920938470811530194312354461908

But according to PRBMath, this is the answer:

340282366920938463220434743172917753977

I truncated the decimals in the Wolfram answer so that the numbers have the same precision.

The absolute delta between the two answers is a whopping 7591095451139436707931, a number with 21 digits!

@PaulRBerg
Copy link
Owner Author

Question: does adding 64 more magic factors in the "exp2" function increase the accuracy?

PaulRBerg added a commit that referenced this issue Jun 12, 2021
@PaulRBerg
Copy link
Owner Author

Question: does adding 64 more magic factors in the "exp2" function increase the accuracy?

Nope, that didn't cut it. What I ended up doing was change the internal representation used in PRBMath.exp2 from 128.128-bit to 192.64-bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant