marcomaggi/vicare — Issue #30: atan on small imaginary numbers loses precision
Author: barak
Created: 2011-11-23 10:40:43+00:00
State: open

for small x, (atan x) is approximately x, since (atan 0) is 0 and the derivative of atan at 0 is 1. However for small imaginary arguments, there is a loss of precision causing bogus low digits and, for small enough arguments, rounding down to zero.

vicare> (atan 1e-20i)
0.0+0.0i

This is caused by (log (+ 1 e)) when e is small. The "right" fix is to use the C function log1p, which means an interface to that must be created, should probably be exposed at the user level, etc.