MathGroup Archive 2006

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

Search the Archive

Re: critical points of a third order polynomial fit (simplification)

  • To: mathgroup at
  • Subject: [mg68490] Re: [mg68466] critical points of a third order polynomial fit (simplification)
  • From: Andrzej Kozlowski <akoz at>
  • Date: Mon, 7 Aug 2006 01:41:11 -0400 (EDT)
  • References: <> <> <> <> <>
  • Sender: owner-wri-mathgroup at

On 6 Aug 2006, at 18:45, Chris Chiasson wrote:

> Per offlist discussion with Andrzej Kozlowski, it is seen that
> Mathematica is capable of detecting the numerical ill conditioning in
> this problem when using arbitrary precision numbers. This can be
> tested by appending the following replacements to the definition of
> bracket:
> /. x_Real?InexactNumberQ :> SetPrecision[x, 14]
> /. x_Real?InexactNumberQ :> SetPrecision[x, 32]

Actually, what hapens in this case is that unless you use precision  
of at least 24 both expressions will return the same (not very  
useful) output: {ComplexInfinity, Indeterminate}. You need precision  
of at leat 25 to get one guaranteed correct digit, in which case you  
will get





With lower precision at some point of the computation Mathematica  
attempts to evaluate 1/0``11.03871382942938 (which it interprets as  
ComplexInfinity) issues a warning to the effect that it encountered  
division by zero and then returns the answer {ComplexInfinity,  
Indeterminate}. Although this answer is not very useful, it will be  
the same for both expression and you can see from it that Mathematica  
arrived at an approximate 0, which has 0 digits of Precision (and 11  
of accuracy). This tells you that you should significantly increase  
the precision of your input.

All of this can be avoided by using exact numbers in the input and  
writing everything as

N[expression to be computed,n]

where n is the number of correct digits you want to have in the  
output. Mathematica should then itself choose the right precision in  
the input that guarantees the requested number of digits in the  
output. I think that in most cases this approach is more efficient  
and convenient than using SetPrecision.

Andrzej Kozlowski

  • Prev by Date: Re: Re: returning a variable's name, rather than the variable's contents
  • Next by Date: Re: Re: Finding the Number of Pythagorean Triples below a bound
  • Previous by thread: Re: critical points of a third order polynomial fit (simplification)
  • Next by thread: Re: critical points of a third order polynomial fit (simplification)