constants, simplification, numerical evaluation



On Fri, Mar 14, 2008 at 7:42 PM, Richard Fateman
<fateman at cs.berkeley.edu> wrote:
>  I think that an annoying aspect has been that (3+4*%i)^2, numer  doesn't do what you probably want; compare with rectform(%);

That's yet another bad case.  Not even float((3+4*%i)^2) gives you
-7.0+24.0*%i. 3+4*%i is only recognized as a number in few contexts in
Maxima.

Interestingly, the special case %e^(2+4*%i),numer *is* handled today,
but (2+4*%i)^2,numer is not.

>  I would like to take the special check for $%pi out of the main program of
>  the simplifier, the program simplifya...

Not sure what you mean here.  I assume you want sin(%pi/7),numer to
give a numerical result? Currently, that happens because of the
special check for %pi. The alternative would be, I suppose, for sin
(and other functions which can take a float arg to a float result) to
test its argument for being an explicit numerical constant (this is a
different test from constantp or numberp), and in that case force it
to float.

                -s