Am Sonntag, den 30.08.2009, 17:44 +0200 schrieb Dieter Kaiser:
> Am Sonntag, den 30.08.2009, 17:25 +0200 schrieb Stefano Ferri:
> > Thank you for the explanation. I missed the related discussion on the
> > mailing list. I had no idea that the old behaviour could cause such
> > problems.
> >
> > Anyway, given, for example, 2^(5/2), is there the possibility to let
> > Maxima rewrite it to 4*sqrt(2) or, as I can imagine, Maxima
> > automatically doesn't allow this?
> > Mine was simply an "aesthetic" issue, because I would like to see some
> > final results of the computation in the form something*sqrt(something
> > else), with integer powers separeted form fractional ones. But it's
> > not a problem!
>
> Sorry, but now there is no way to display the internal representation
> 2^(3/2) as 2*sqrt(2).
>
> The display package has special code to display the internal
> representation x^(1/2) as sqrt(x).
>
> I am wondering if we can extend the display package to display e.g.
> 2^(3/2) as 2*sqrt(2) accordingly.
I had a look at the code of nforma.lisp.
I think it is not difficult to extend the display package to get the
desired output on the display. This is a first and fast extension to the
routine form-mexpt:
((and $sqrtdispflag (alike1 3//2 (caddr form)))
(list '(mtimes) 2 (list '(%sqrt) (cadr form))))
((and $sqrtdispflag (alike1 '((rat) -3 2) (caddr form)))
(list '(mquotient) 1 (list '(mtimes) 2 (list '(%sqrt) (cadr form)))))
This will give:
(%i10) 2^(3/2);
(%o10) 2*sqrt(2)
(%i11) 2^(-3/2);
(%o11) 1/(2*sqrt(2))
This can be generalized for general expressions with a sqrt function.
Dieter Kaiser