More consistent handling of 4.0*x - 3.0*x



Am Montag, den 29.06.2009, 08:54 -0600 schrieb Robert Dodier:
> OK by me, but while we're at it, I think float(x) should
> yield 'float(x) instead of just x, likewise for bfloat(x).
> 
> (If we're going to the trouble to make (literal float)*variable
> work correctly with lazy evaluation, we should do
> the same for float(variable).)
> 

I have committed the suggested change to plusin to get more consistent
results.

This is the old behavior before the changes to PLUSIN:

(%i20) (4.0*x-4.0*x);
(%o20) 0
(%i21) (4.0*x-3.0*x);
(%o23) x
(%i24) (4.0*x-3.0*x)/2;
(%o24) x/2

This is the new simplification:

(%i22) (4.0*x-4.0*x);
(%o22) 0.0
(%i23) (4.0*x-3.0*x);
(%o23) 1.0*x
(%i24) (4.0*x-3.0*x)/2;
(%o24) 0.5*x

Dieter Kaiser