[Ecls-list] log(complex) inaccurate for some values

Juan Jose Garcia-Ripoll jjgarcia at users.sourceforge.net
Sun Apr 13 18:42:45 UTC 2008


On Sun, Apr 13, 2008 at 4:03 PM, Raymond Toy <toy.raymond at gmail.com> wrote:
>  But don't use the log function to evaluate this.  Use log1p(z) =
>  log(1+z).  Most C libraries have a log1p function already, but if not,
>  you can just use the series formula since z is small.

Thanks Ray. I did not know about the log1p function. I have changed
ECL to support and export it as a lisp function, adding a simplistic
implementation for the platforms that do not support it (mingw32 I
believe). Now

$ ecl -eval '(print (log #c(1.000000001d0 1d-5)))' -eval '(quit)'

#C(1.0500000821378709d-9 9.999999989666666d-6)

Thanks again for reporting this issue.

Juanjo

-- 
Facultad de Fisicas, Universidad Complutense,
Ciudad Universitaria s/n Madrid 28040 (Spain)
http://juanjose.garciaripoll.googlepages.com




More information about the ecl-devel mailing list