From: Stavros M. <mac...@gm...> - 2024-10-29 15:31:15
|
*great *has one function ("hat") -- providing a standard *internal* ordering. By far the most important use of *great* is in ordering commutative/associative operators, namely *mplus* and *mtimes. *The *great* ordering is designed to make that efficient, so that terms that can be combined are adjacent, for example. Similarly for* diff(f(a,b),b,1,a,1,b,1) => 'diff(f(a,b),a,1,b,2) *and *{b,a,b} => {a,b}*. Another case is where some consistent syntactic ordering is wanted for canonicalization, namely normalizing the sign of even function arguments: *abs/signum/cos/...(a-z) => f(z-a).* But for some reason this doesn't apply to *(z-a)^2 == (a-z)^2, *although *factor *does canonicalize it. I haven't thought enough about it to have an opinion on whether it should. 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". -s |