Skip to content

Fix exponential() #226

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix exponential() #226

wants to merge 1 commit into from

Conversation

db47h
Copy link

@db47h db47h commented May 10, 2025

Fix various issues in exponential() like:

  • ** 1000 needing over 1600 iterations
  • ** -1000 yielding a very large positive number (2.03931737868e+356)
  • ** 2000 not converging after 2570 iterations

The fix involves scaling down x to [0.5, 1) and expanding the Taylor series with increased precision.

The iteration count is now <= 17 with up to 47 multiplications to scale the result in the worst case.

The results are almost always properly rounded, and off by 1 ulp in the worst case.

I'd like to add a test for this, but because of #225, there is no really clean way to do it.

Fix various issues in exponential() like:

- ** 1000 needing over 1600 iterations
- ** -1000 yielding a large positive number
- ** 2000 not converging after 2570 iterations

The fix involves scaling down x to [0.5, 1) and expamding the Taylor
series with increased precision.

The iteration count is now <= 17 with up to 47 multiplications to
scale the result in the worst case.
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

Successfully merging this pull request may close these issues.

1 participant