caps complex tests



Richard Fateman wrote:

>
> 
> radcan itself never produces abs().

Fortunately! In the examples i have tried, radcan worked pretty well for me.

> 
> You (and others)  seem to think that  sqrt( (x^2-2*x+1)/x)  is equal to
> 
> sqrt(1/x)*abs(x-1).
> 
> It is not.
> 
> (defun h(x) (* (sqrt(/ 1.0 x))(abs (1- x))))
> 
> (defun g(x) (sqrt (/ (+ (* x x)(* -2 x) 1) x)))
> 
> evaluate at i =  (complex 0 1.0)
> 
> (h i) is 1 - i
> (g i) is 0-1.414 i
> 
> Does this matter?  I think so.
>

I have been intrigued by this example until i tried 
CL-USER>  (abs (1- #C(0 1.0)))
1.4142135

Thus abs is the modulus, and of course sqrt((x-1)^2) cannot be in general
the modulus of (x-1), except when for example x > 1. 

Personnally i have no problem writing sqrt((x-1)^2=(x-1) knowing that a sqrt 
is defined up to a sign. In your example you will get at most a sign 
discrepancy and you know that this is normal. With this provision, there is 
no problem to write sqrt(x*y)=sqrt(x)*sqrt(y), and indeed if you don't do 
that you will miss a lot of simplifications.

In general i agree with what you are saying, a proper "definition" of sqrt 
is a difficult question. If we limit ourselves to purely algebraic stuff, we 
want to make sense of expressions such as 
sqrt( prod (x-x_i)) which is the same as the hyperelliptic curve

y^2=prod (x-x_i)

The "conventional" way to put branch cuts is to draw a branch cut from x_1 
to x_2, then from x_3 to x_4 etc. and finally from x_{2n+1} to infinity when 
there are an odd number of x. 

On this cut plane one has a determination of y. Of course if more 
complicated stuff is considered, such as a general equation P(x,y)=0
then one has to think much more to present the Riemann surface as a 
dissected plane with identified edges. If one considers non algebraic stuff 
such as logs, things are more and more complex. Let us recall that
even the simplest non trivial case of sqrt, that is 
y^2=P_4(x) where P is of degree 4 leads to elliptic integrals and maxima
doesn't know how to cope with that (maple and mathematica know, but in a 
very messy way).



-- 
Michel Talon