axiom-developer
[Top][All Lists]

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

 From: Francois Maltey Subject: Re: [Axiom-developer] Bug 215: sin asin(7.0::COMPLEX FLOAT) Date: 17 Jan 2007 18:25:03 +0100 User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

```Hi Waldek and all !

> 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

I don't see where the problem is in TrigonometricFunctionCategory
What is the problem if the axiom file trigcat.spad contains :

if R is a complex numeric ring then
asin can contains tests for ejecting problems in the atan special cases.
[or uses the log formula, if there is a log]

if R is a real numeric ring then
asin test the interval [-1, 1]

if R has log:R->R and imaginary:R->R then
asin x == -%i*log(%i*x+sqrt(1-x^2))
-- is the most serious method because it's the most known formula.

else ... I have no idea ...

It's almost necessary to have complex inside formal expression
because a sqrt(-1) can very quickly appear :
sqrt is an usual function and -1 is an usual number.

> 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).

Must this feature remains
or is it a good idea to retains axiom to claim that
Re(x+%i*y)=x and Im(x+%i*y)=y in usual cases.

Of corse theses equalities are right for algebraic computation,
but I (we?) also use axiom for analysis calculus...

I'll hope I can show/use axiom to/with my students
but in theses case I need calculus packages that are near

We might also think that axiom will use (some years later)
intervals for computation, it's useful for understand well posed formula :
test the 3 sequences.
u(n+1)=(8*u(n)-1)
with u(0) = 1/7
or u(0) = 1/7.0
or u(0) = the numerical interval [1/7-numerical error, 1/7+numerical error]

An other exercice I give sometimes to my students :
solve the formal z^4+2*m*z^2+1 polynomial in z,
and plot the curve solution into Complex plan for m in R.

Neither early maple nor early mupad do it with a finest way.
I don't know what axiom can do in this case.

Francois

Today my students noticed that I write log and not ln on the blackboard.
You understand why !
French stuents dislike, but what is the international function name.

```