ivy icon indicating copy to clipboard operation
ivy copied to clipboard

Fix exponential()

Open db47h opened this issue 11 months ago • 0 comments

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.

db47h avatar May 10 '25 23:05 db47h