guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: acosh, getting consistent results from GSL and Guile


From: Daniel Llorens del Río
Subject: Re: acosh, getting consistent results from GSL and Guile
Date: Fri, 18 Aug 2006 18:25:15 +0200


On 18 Aug, 2006, at 18:07, address@hidden wrote:

Browsing Wikipedia for acosh  formulas it seems to me
that GSL is using an equivalent of:

   (log (- x (sqrt (- (* x x) 1))))

while the others are using an equivalent of:

   (log (+ x (sqrt (- (* x x) 1))))

I'm interested in having equal results from GSL
and Guile, [...]

and got the following reply:

There are different branch cut conventions used
by different programs. acosh or other inverse
functions are mutiple-valued functions so the
result is not uniquely defined.

GSL uses one of the two common conventions
(W.Kahan's) because it has better consistency with
IEEE arithmetic.  It is also used by Common
Lisp -- see the GSL Reference manual for details and
references.  The others are using a different
convention (Abramowitz & Stegun).  As such, all the
answers are correct.

So, do you suggest me to override the GSL function to
make it equal to the Guile one, or vice versa?

Myself, I'd be happy if only things like this didn't happen:

guile> (tanh 1e3+i)
+nan.0

 - Daniel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]