MathGroup Archive 2010

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

Search the Archive

Code optimization

  • To: mathgroup at
  • Subject: [mg109764] Code optimization
  • From: "S. B. Gray" <stevebg at ROADRUNNER.COM>
  • Date: Sun, 16 May 2010 05:57:02 -0400 (EDT)
  • Reply-to: stevebg at ROADRUNNER.COM

Suppose I have an expression like

foo =(expression 1)/denominator + (expression 2)/denominator

where "denominator" is itself a complex expression. Is it worthwhile for 
me to compute "denominator" once and use it explicitly in foo, or will 
Mathematica cleverly deduce that it needs to be computed only once?

My guess is that Mathematica is an interpreter so it will not optimize the code.

Steve Gray

  • Prev by Date: Latex, Mathematica, and journals
  • Next by Date: Questions about Word Wrap etc.
  • Previous by thread: Re: Latex, Mathematica, and journals
  • Next by thread: Re: Code optimization