I think there is one way here, if we extend the notion of
"number" in common lisp to include bigfloats as well as machine floats.
Perhaps making 1.0e0 1.0d0 1.0b0 all acceptable.
Then follow the lisp rules as much as we can.
This is essentially an efficiency hack for when the numbers
are in fact floats and we can use common lisp directly.
We have to be careful though, because there are almost
alway edge effects between "efficient" and "general".
For other forms, e.g. polar, introduce (($polar) r theta).
Now this still leaves us with symbolic complex numbers e.g.
x+%i*y assume x,y real.
and what to do with
1/(x+%i*y) etc.
..............
Another way is to use algebraic extensions in
some general setting. That is, complex numbers are
polynomials in q x+y*q where q^2=-1.
Very similar to 3+4*sqrt(7) i.e. 3+4*q where q^2=7.
This is fairly close to what we have now with algebraic:true,
but it somehow doesn't seem to work well enough.
Maybe by listing all the requirements, we can understand
how this fall short for us now, and how to get out of this
hole. As well as how this is handled by other CAS.
RJF
Stavros Macrakis wrote:
>If you have an expression containing only numbers, the best way to put
>it in the form a+b*%i is rectform (rectangular form). Expand etc.
>only happen to work in this case because of the form of the
>expression. It is entirely luck that integrate(...),numer gives you a
>result in that form in this case.
>
>It has been proposd that complex numbers become full-fledged Maxima
>numbers, so operations on them are always carried through. That is
>certainly possible, but to be consistent about it, we'd also have to
>support rational and bfloat complex numbers. And then, what if the
>user prefers to work with the polar form? That is more intuitive in
>many cases. How would you prevent Maxima from 'simplifying' 3.4 *
>exp(%i*1.0e-6) to 3.4e-6*%i+3.4?
>
> -s
>
>_______________________________________________
>Maxima mailing list
>Maxima@www.math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima
>
>