Getting rid of annoying zeroes in algebraic expressions

• To: mathgroup at smc.vnet.net
• Subject: [mg15228] Getting rid of annoying zeroes in algebraic expressions
• From: "Ross, Sean" <rosss at plk.af.mil>
• Date: Wed, 23 Dec 1998 01:04:05 -0500
• Sender: owner-wri-mathgroup at wolfram.com

```Let xx be the result of some algebraic manipulations which, for some
reason, mathematica thinks the real zeroes ought to be kept and I think
they ought to be dropped.

xx=0. + (a*f)/(0. + f) + (b*f)/(0. + f) + (c*f)/(0. + f)

xx/.Plus[0.,q_]->q

returns

0. + (a*f)/(0. + f) + (b*f)/(0. + f) + (c*f)/(0. + f)

while

0. + (a*f)/(0. + f) + (b*f)/(0. + f) + (c*f)/(0. + f)/.Plus[0.,q_->q]

returns the expected

a+b+c.

xx is supposed to be equivalent to the expression, but in this case, it
is not.
I can't write a function to automatically drop zeroes if expressions
behave differently when they are alone on an input line and when they
are set equal to a symbol.  Does anyone know how to eliminate this kind
of behavior?  I am sure it has something to do with some obscure step
in the "standard evaluation cycle" and that there is probably a long,
convoluted explanation as to why someone would want this behavior, but
I don't and I would appreciate it if someone could tell me how to get
rid of it or circumvent it.

Thanks,

Sean Ross

Please reply to rosss at plk.af.mil as I no longer subscribe to the
mathgroup.

------_=_NextPart_000_01BE2DE8.422DB28A

AA0AEgAlAAIAPQEBCYABACEAAAAzRkE5RUYwQkMxOTlEMjExOUIxRTAwODA1RkE3ODcxNgAwBwEE
gAEAOAAAAEdldHRpbmcgcmlkIG9mIGFubm95aW5nIHplcm9lcyBpbiBhbGdlYnJhaWMgZXhwcmVz
c2lvbnMA9RQBDYAEAAIAAAACAAIAAQOQBgBYCQAAMQAAAAIBcQABAAAAFgAAAAG+LehjCUPqLSKZ
ZhHSpREAYJcznZQAAAMA3j+vbwAAAwAIgAggBgAAAAAAwAAAAAAAAEYAAAAAUoUAAOMVAAAeAAmA
hQAAAQAAAAEAAAAAAAAAHgAngAggBgAAAAAAwAAAAAAAAEYAAAAAN4UAAAEAAAABAAAAAAAAAB4A
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