MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

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

eJ8+IicUAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy
b3NvZnQgTWFpbC5Ob3RlADEIAQWAAwAOAAAAzgcMABYADQASACUAAgA9AQEggAMADgAAAM4HDAAW
AA0AEgAlAAIAPQEBCYABACEAAAAzRkE5RUYwQkMxOTlEMjExOUIxRTAwODA1RkE3ODcxNgAwBwEE
gAEAOAAAAEdldHRpbmcgcmlkIG9mIGFubm95aW5nIHplcm9lcyBpbiBhbGdlYnJhaWMgZXhwcmVz
c2lvbnMA9RQBDYAEAAIAAAACAAIAAQOQBgBY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YubWlsPgAAAHoh

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


  • Prev by Date: Re: Re: Compile and NormalDistribution
  • Next by Date: Re: strange function that defines a function---how do I do it?
  • Previous by thread: Re: Re: Algebra on complex expressions: Collect
  • Next by thread: Re: Getting rid of annoying zeroes in algebraic expressions