axiom-developer
[Top][All Lists]

## Re: [Axiom-developer] Bug 215: sin asin(7.0::COMPLEX FLOAT)

 From: Waldek Hebisch Subject: Re: [Axiom-developer] Bug 215: sin asin(7.0::COMPLEX FLOAT) Date: Wed, 17 Jan 2007 16:54:19 +0100 (CET)

```I wrote:
> There is an easy workaround, put:
>
> asin x == -atan(-x/sqrt(1-x**2))
>

After further examination I have found that this does not work
(appearantly I was using different version for machine test, and
analysis shows that the formula above is wrong).  Actually,
now I am convinced that there is no simple "real" formula giving
correct branch cuts.  Official Lisp formula for asin is

asin x == -%i*log(%i*x+sqrt(1-x^2))

The Lisp formula stays away from branch cuts of logarithm, and only
branch cut of sqrt matters (and defines brunch cuts of asin).

So, to get correct asin we need a real function which contains
-%i*log as the last step of computation.  However, our only
primitive of this sort is atan and contains spurious branch cut.

So we probably need to provide a complex asin in Complex (or throw
error for computations on branch cuts).  We could also try to use
complex formula in TrigonometricFunctionCategory, but I am affraid
that Axiom assumes in too many places that real functions of
real arguments are computed in "real way", we could easily get
wrong results (starting from enexpected complex expressions to
plain wrong).

--
Waldek Hebisch