From: Stavros M. <mac...@gm...> - 2024-10-29 17:57:16
|
Good point. The documentation for *powerdisp* is incomplete/misleading. It reads: When ‘powerdisp’ is ‘true’, a sum is displayed with its terms in order of increasing power. But as you say, it actually reverses *all* the terms, not just the powers: apply('matrix,makelist( [ string(ex), block([powerdisp:true],string(ex))], ex, [x+y, a+b, x^3+y^2+z, z^3+y^2+x, z^2+x^2])); [ y+x x+y ] [ ] [ b+a a+b ] [ ] [ z+y^2+x^3 x^3+y^2+z ] [ ] [ z^3+y^2+x x+y^2+z^3 ] [ ] [ z^2+x^2 x^2+z^2 ] On Tue, Oct 29, 2024 at 1:28 PM Robert Dodier <rob...@gm...> wrote: > On Tue, Oct 29, 2024 at 8:33 AM Stavros Macrakis <mac...@gm...> > wrote: > > > Using great ordering for displaying products and reversed great ordering > for sums is, as I said, "a crude heuristic, but it produces pretty good > results". To improve on that, great should not be modified -- that should > be done in nformat, which already does things like > a*b^-1*c*q^-1*w*x^-1*y*z^-1 (internal format) => (a*c*w*y)/(b*q*x*z) > (external format), rat(2,3)*x => (2*x)/3, x^rat(-1,2) => 1/sqrt(x), etc. > > > > Maybe you could start by making a list of cases where you think Maxima > is producing suboptimal display orderings. Keep in mind that the ordering > often depends on what is considered a "variable" and what is considered a > "parameter". > > I haven't been following closely, but anyway see also the global flag > powerdisp which governs whether "+" expressions are displayed with > terms as ordered by GREAT, or in the opposite order. I forget which is > the default. > > HTH > > Robert > |