ratsimp and the order of terms



-----maxima-bounces at math.utexas.edu wrote: -----

>(%i8)?x:a+s+d+f+g+h+j+k+l;
>(%o8)?s?+?l?+?k?+?j?+?h?+?g?+?f?+?d?+?a
>
>This?is?the?internal?order?of?the?symbols:
>
>(%i9)?:lisp?$x
>((MPLUS?SIMP)?$A?$D?$F?$G?$H?$J?$K?$L?$S)
>
>Now?the?order?after?a?call?to?ratsimp.?The?order?of?the?symbols?is
>reverse:
>
>(%i10)?:lisp?($ratsimp?$x)
>((MPLUS?RATSIMP)?$S?$L?$K?$J?$H?$G?$F?$D?$A)
>
>So,?when?I?do?an?alike1?between?the?expression?and?the?result?of?ratsimp
>the?expressions?seems?to?be?different:
>
>(%i10)?:lisp?(alike1?$X?($ratsimp?$x))
>NIL

>From Common Lisp, code should call sratsimp, not $ratsimp:

 (%i29) :lisp ($ratsimp $x);
 ((MPLUS RATSIMP) $S $L $K $J $H $G $F $D $A)

 (%i29) :lisp (sratsimp $x);
 ((MPLUS SIMP) $A $D $F $G $H $J $K $L $S)

I think it's correct that the testsuite catches these bugs.

Barton