# Why don't 1. (0. + a) or (0. + 1. a) simplify?

I'm handling some mixed-numeric-analytic expressions, and I feel I'm missing some subtleties of how Mathematica handles simplification of such expressions.

In particular, I was initially puzzled by the fact that

0. + a


(with a undefined) will not simplify to a, but of course this forgets that 0. and 0 are not the same, and that if, say, one later on sets a=1 then 0+a will return an exact result but 0.+a will return a float.

However, if one takes this a bit further, to the expressions

0. + 1. a


and

1. (0. + a)


then they will still be returned intact. By the criterion above, simplifying them to 1. a and 0.+a would be functionally equivalent, so I feel I'm missing something. Does Plus[0.,expr] only simplify further if expr is a numeric expression? Does Mathematica decide not to delve into the depths of expr, potentially taking some overhead in complicated expressions, to save some complicated analysis? Or are the different expressions not actually equivalent?

Or am I just over-reading into this?

• 'a' is exactly precisely 'a', no uncertainty or approximation or error involved. '0.' is approximately zero, only within the uncertainty and approximation and error that all machine precision floating point numbers have. If you really want to do it then Chop can make approximate 0. go away in most cases and Rationalize can make approximate 1. go away in most cases. All this is only approximately true.
– Bill
Sep 17, 2015 at 21:05
• If I read your 1.(0.+a) as "approximately one times the expression approximately zero plus exactly a" then maybe I could justify that as being the same as "approximately zero+approximately one times a" and Expand[1. (0. + a)] returns 0. + 1. a if you like that any better. But it seems that anything MMA does or doesn't do is often met by two camps, one of which are unhappy it didn't do more and the other who are unhappy it did it at all. Trying to get it to not do something often seems more difficult than getting it to do something.
– Bill
Sep 17, 2015 at 22:51
• You might do a little pencil and paper experiment. Consider 1. is 1 plus/minus something less than 10^-16, 0. is 0 plus/minus something less than 10^-16 and 'a' is exactly 10^(10^9). Then what is the uncertainty? And repeat the exercise with 'a' being exactly 10^(-10^9). You want to check whether each of your various expressions that seem the same to you have the same uncertainty as the original expression did, no matter what value 'a' might have. Note: I'm fudging a little with that uncertainty of zero, but it should be good enough for you to understand.
– Bill
Sep 17, 2015 at 23:12
• Some functions which you might want to try and play around with (if you haven't yet) are Expand and Chop. Sep 18, 2015 at 3:48
• I guess it's because the FullForms of 1. (0. + a) and 1. (0. + a)// Expand  have same length? Sep 18, 2015 at 8:46

  0. + a // Chop