From: Barton W. <wi...@un...> - 2024-10-29 18:49:45
|
I've grown mostly neutral to the visual display of expressions. It's the bugs that bug me: (%i1) (domain : complex, declare(z, complex))$ (%i2) orderlessp(sqrt(exp(z)),exp(z)); (%o2) false (%i3) orderlessp(exp(z), sqrt(exp(z))); (%o3) false --Barton ________________________________ From: Stavros Macrakis <mac...@gm...> Sent: Tuesday, October 29, 2024 10:30 To: Barton Willis <wi...@un...> Cc: Eduardo Ochs <edu...@gm...>; <max...@li...> <max...@li...> Subject: Re: [Maxima-discuss] ((MPLUS SIMP FACTORED) 2 3) -> 3 + 2 Caution: Non-NU Email 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 |