# Mathematica won't simplify multiplication by zero

I'm getting a huge output, but it appears that almost every term should actually be zero, unless I'm misunderstanding the expression.

For example, part of the output reads

a (0.25 + 0. b) + b^2 (0. + 0./c) + b (-1. + 0. c) - 0.5 c + (b (-1. b - 0.5 c) c)/a^2


Simplify and FullSimplify won't get rid of these zero terms even with assumptions that a,b and c are real and non-zero. Suggestions ?

-
Examine the FullForm of the result. You may be surprised. Chop is useful too. – Sjoerd C. de Vries Oct 28 '13 at 17:33
SetOptions[Simplify, TransformationFunctions :> Function[x, x //. {0. -> 0, 1. y_ :> y, -1. y_ :> y}]] and then Simplify simplifies as you want. – Rolf Mertig Oct 28 '13 at 18:29
@RolfMertig. I think you meant to write -1. y_ :> -y – RunnyKine Oct 28 '13 at 20:15
@RunnyKine : sure. thanx. – Rolf Mertig Oct 28 '13 at 22:27

To get what was said in the comments on record as an answer.

Chop is probably what you are looking for.

expr =
a (0.25 + 0. b) + b^2 (0. + 0./c) + b (-1. + 0. c) - 0.5 c +
(b (-1. b - 0.5 c) c)/a^2 // Chop

0.25 a - 1. b - 0.5 c + (b (-1. b - 0.5 c) c)/a^2


You might want to go further

expr = expr /. {1. x_ :> x, -1. x_ :> -x}

0.25 a - b - 0.5 c + (b (- b - 0.5 c) c)/a^2

-