kfp wrote:
> 
> In* efstruc.spad* (line 423): is?(op, 'asin)  => atan(z / sqrt(1 - z^2))
> 
> yields:
> 
> (1) -> f(z)== atan(z / sqrt(1 - z^2))
>                                                                    Type: 
> Void
> (2) -> f(sin(z))
>    Compiling function f with type Expression(Integer) -> Expression(
>       Integer)
> 
>                    sin(z)
>    (2)  atan(----------------)
>                +-------------+
>                |        2
>               \|- sin(z)  + 1
>                                                     Type: 
> Expression(Integer)
> (3) -> normalize %
> 
>    (3)  - z
>                        
> Apparently we have:
> 
> (4) -> test(normalize atan(sin(z)/cos(z)) = normalize 
> atan(sin(z)/sqrt(cos(z)^2)))
> 
>    (4)  false
>                                                                 Type: 
> Boolean
> Either sqrt gives wrong sign or it happens when converting to tan(z/2) ...
> 
> (5) -> normalize sqrt(1-sin(z)^2)^-1
> 
>              z 2
>          tan(-)  + 1
>              2
>    (5)  -----------
>              z 2
>          tan(-)  - 1
>              2
> 
> hm, really strange.

Yes, after convertiong to tan(z/2) we get wrong sign from sqrt.
ATM I do not see good cure for this.  Algebraically two square
roots are indistinguishable.  We choose one which gives positive
coefficient to tan(z/2)^2 (that is positive coefficient for the
leading term).  But in this case we want positive coefficient
for constant term.

One possible solution could track square roots and choose branch
based on origin of the square root.  But this looks awkward, and
we will have trouble if during nomalization two roots of different
origin happen to be equal.

-- 
                              Waldek Hebisch
[email protected] 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to