Re: Evaluation question
- To: mathgroup at smc.vnet.net
- Subject: [mg80362] Re: Evaluation question
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sun, 19 Aug 2007 01:30:16 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <fa13jg$nua$1@smc.vnet.net> <fa6eor$dk1$1@smc.vnet.net>
David Bailey wrote: > Yaroslav Bulatov wrote: >> Abs[-1 - 2 E - E ^2 + (1 + E)^2] >> Evaluate[%] >> >> Why is the "N::meprec" message only printed once? >> >> > Although Mathematica appears to evaluate expressions from scratch, for > performance reasons, it keeps information that lets it know that an > expression cannot change by further evaluation. This information is > quite subtle, because if an expression contains a variable, it > recognises that it needs to re-evaluate if the variable is given a value. Just an additional thought to David's explanations: if one wants to force the (re)evaluation of an expression, one can use *Update*. For instance, the following produces two warning message because the first expression is evaluated again (Mathematica behaves like if something has changed that could altered the value of the first expression). In[1]:= Abs[-1 - 2 E - E^2 + (1 + E)^2] Update[] Evaluate[%%] During evaluation of In[1]:= N::meprec: Internal precision limit \ $MaxExtraPrecision = 50.` reached while evaluating -1-2 \ \[ExponentialE]-\[ExponentialE]^2+(1+\[ExponentialE])^2. >> Out[1]= Abs[-1 - 2 \[ExponentialE] - \[ExponentialE]^2 + (1 + \[ExponentialE])^2] During evaluation of In[1]:= N::meprec: Internal precision limit \ $MaxExtraPrecision = 50.` reached while evaluating -1-2 \ \[ExponentialE]-\[ExponentialE]^2+(1+\[ExponentialE])^2. >> Out[3]= Abs[-1 - 2 \[ExponentialE] - \[ExponentialE]^2 + (1 + \[ExponentialE])^2] -- Jean-Marc