Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

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: [mg68491] Re: [mg68466] critical points of a third order polynomial fit (simplification)
  • From: "Chris Chiasson" <chris at>
  • Date: Mon, 7 Aug 2006 01:41:22 -0400 (EDT)
  • References: <> <> <> <> <> <>
  • Sender: owner-wri-mathgroup at

This convinces me:
If I do end up needing a more precise answer for this part of my code,
I will use Rationalize & then convert back to the WorkingPrecision,
rather than using SetPrecision.


On 8/6/06, Andrzej Kozlowski <akoz at> wrote:
> 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
> Precision[x/.rep[3]/.rep[5]//InputForm]
> 1.42222
> Precision[x/.rep[4]/.rep[5]//InputForm]
> 1.42222
> 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: Finding the Number of Pythagorean Triples below a bound
  • Next by Date: Re: critical points of a third order polynomial fit (simplification)
  • 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)