simplification of -(quotient)



On 5/14/07, Barton Willis <willisb at unk.edu> wrote:

> (%o3) (b+a)/c+(-b-a)/c         [[ doesn't simplify to 0 ]]
>

Yes, this is annoying.  Then again, the general simplifier doesn't simplify
lots of simple things, e.g. (1+a)/a - 1 #> 1/a or 2*(a+b)-a-b #> a+b -- and
isn't supposed to.  Perhaps we need a level of simplification between the
general simplifier (which is fast but doesn't do many simple
simplifications) and rat/ratsimp, which often makes expressions blow up or
change form unrecognizably.

With negdistrib : false, the general simplifier crunchs p - q to zero


Yes, but resimplification (i.e. expand(%o3,0,0) ) doesn't simplify
(b+a)/c+(-b-a)/c to 0 regardless of the setting of negdistrib.

I say that the fact that (%o3) isn't 0 is a bug?
>

It is definitely not a "bug" -- it is intended to operate like this.  It may
be an design decision we should revisit, but that's another matter....

I believe this came up in your work on the test suite.  In the context of
testing, this shouldn't matter.  The expected output should simply be
constructed to be precisely what is output by the code....

             -s