Comment #7 on issue 3073 by [email protected]: Ordering args in Adds when printing to move negative signs
http://code.google.com/p/sympy/issues/detail?id=3073
I just checked, and the TI89 is not as smart as I remember it. I think we can improve upon it. It does turn -x + y into y - x, and -x**2 + y**2 into y**2 - x**2. But -x**2 + x + y**2 - y is left alone. So I guess they just favor lex ordering when the simple heuristic doesn't come into play.
One thing that it does a little of and that we can do is rewrite fractions so that there are minimal minus signs, so e.g., (-x**2 + x + 1)/(-x + y) is turned into (x**2 - x - 1)/(x - y). But it turns (-x**2 + x + 1)/(-y + x) into -(x**2 - x - 1)/(x - y). So it seems that the algorithm favors an ordering of x first then y over minimizing minus signs.
Of course, then we get into the question of if we really want to canonicalize (x - y)/(a - b) and (y - x)/(b - a) into the same thing.
I've yet to use a CAS that writes things the way I would automatically (or even after calling simplify()). Maple comes the closest by just leaving things exactly the way I entered them, but after an operation of some function, this doesn't matter any more, and it's just as bad (or good) as the rest.
-- You received this message because you are subscribed to the Google Groups "sympy-issues" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy-issues?hl=en.
