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 exponential functions precision #46

Open
10 tasks done
apelloni opened this issue Jan 8, 2025 · 1 comment
Open
10 tasks done

Increase exponential functions precision #46

apelloni opened this issue Jan 8, 2025 · 1 comment

Comments

@apelloni
Copy link
Contributor

apelloni commented Jan 8, 2025

To keep track of the things being fixed for the exponential functions and increase the precision.

exp() was precise only up to f64 and with #42 matches TwoFloat.

TODO:

  • exp_m1() has similar issues where now a.exp() -1.0 is more precise than running a.exp_m1()
  • a.exp2() less precise than running (a*LN_2).exp()
  • adjust tests to reflect a higher precision as expected from double-double arithmetic

Unrelated to EXP but exposed while improving the precision

  • log10 poor precision due to 1/LN_10 lost accuracy
  • Fix division
    • f64/ TF
    • TF/TF
    • TF/f64?
    • TF/=TF
    • TF/=f64?
@apelloni
Copy link
Contributor Author

apelloni commented Jan 8, 2025

both exp_m1 and exp2 where affected by wrong coefficients in the various EXP#_COEFFS arrays.
Now, they all use the same FRAC_FACT array containing the inverse factorial coefficients.

I've updated them in fbdc57c and 2958f6d.

I use the rescaling trick also for exp2 to improve the convergence, where 2^r is rewritten as (2^r')^512

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