Maxima complex numbers (Was Re: display of lisp complex numbers in wxmaxima)



On 4/30/12 6:12 PM, Richard Fateman wrote:

> 
> I suppose the rest of this note should be in a separate
> message ....
> 
> There are subtle issues with representing 3+4*%i as a lisp
> complex number.  For example,
>  3.0b0+4.0b0*%i cannot be a lisp complex number.

And don't forget that 4.0*%i is not really #c(0d0 4d0) for Lisp's that
have signed floating-point zeroes.  But this is really an esoteric
corner case that is important only if you really, really need to deal
with branch cuts on the imaginary axis.
> 
> But introducing lisp complex numbers into maxima sometimes
> may be helpful. Extending bigfloats to complex bigfloats
> may also be helpful.

This has been done in the bigfloat package that's built into maxima.
Using (bigfloat:to <3b0+4b0*%i>) will convert to it to a bigfloat object
that you can manipulate as if it were a standard Lisp complex object.
At the end, when you need to get a representation that maxima
understands, use (maxima::to <bigfloat object>).

> 
> 
>  Does anyone actually need 1/(3+4*%i)  or can we always
> clear the denominator ... 1/25*(3-4*%i) ?

This is probably one of the corner cases like whether sqrt(2)/2 should
be automatically converted to 1/sqrt(2) or vice versa?  It seems that
long ago maxima did not convert sqrt(2)/2 to 1/sqrt(2) unless asked to.
 Current maxima always does the conversion.

Ray