Am Montag, den 14.09.2009, 05:20 -0500 schrieb Barton Willis:
> Is there any reason to use csign instead of $csign in /src? One place I
> would like
> to use $csign is simpsgnum:
>
> (defmfun simpsignum (x y z)
> (oneargcheck x)
> (setq y (simpcheck (cadr x) z))
> (setq z ($csign y))
> ;; When $csign thinks y is complex, let it be.
> (cond ((memq z '($complex $imaginary)) (eqtest (list '(%signum) y) x))
>
> Changing csign --> $csign in simpsignum fixes a bug the Sage developers
> have long wanted fixed
> (this is the correct solution set, I think)
>
> (%i3) to_poly_solve(q*sqrt(2+q^2)-1,q);
> (%o3) %union([q = 1/sqrt(1-sqrt(2))],[q = 1/sqrt(sqrt(2)+1)])
> (%i4) build_info();
>
> Maxima version: 5.18post
> Maxima build date: 4:45 9/14/2009
> Host type: i686-pc-mingw32
> Lisp implementation type: SBCL
> Lisp implementation version: 1.0.29
>
> I'd guess that conjugate could also benefit by using $csign.
I have implemented $csign to get a stronger test for complex expressions
including functions and symbols which are declared to be complex.
I think csign is much too weak. $csign is stronger, but not perfect. The
function can be improved further.
There is one problem with $csign. Because the functions for the complex
components rectform, abs, carg, ... and the sign and $csign function are
related it might be possible that we get subtle bugs like the problems
we had with the definite integrals. For these integrals we have got
sometimes an endless loop. We had to switch off the flag limitp when in
$csign.
But I think it is useful to use $csign at more places to get code which
handles complex expressions more completely and to improve $csign
further.
Dieter Kaiser