MathGroup Archive 2011

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

Search the Archive

Re: Why Mathematica does not issue a warning when the calculations are losing so much precision that the results are not anymore useful?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117556] Re: Why Mathematica does not issue a warning when the calculations are losing so much precision that the results are not anymore useful?
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Tue, 22 Mar 2011 05:10:08 -0500 (EST)

On 3/21/11 at 6:13 AM, pireddag at hotmail.com (John Travolta Sardus)
wrote:

>With Mathematica 8.0.1

>N[FractionalPart[(6 + Sqrt[2])^20]]

>Result:

>-160.

>Is it a problem for all numerical software being able to recognize
>when these calculations cannot be performed with the given machine
>accuracy? Does this happen in this case only (where a wrong result
>is easily recognized) or in other cases too?

In Mathematica, when you use N with no second argument as you
did above, computation is turned over to your system hardware
which determines what accuracy you get. If you want Mathematica
to control the accuracy, you need to use the second argument so
as to invoke Mathematica's arbitrary precision arithmetic.

On my system, when I copy and past from your code I get

In[5]:= N[FractionalPart[(6 + Sqrt[2])^20]]

Out[5]= -160.

as you show above. But by making use of the second argument to
N, I can do:

In[6]:= N[FractionalPart[(6 + Sqrt[2])^20], 16]

Out[6]= 0.6877782033820121



  • Prev by Date: Re: Jacobian
  • Next by Date: Re: NestList integration bug?
  • Previous by thread: Re: Why Mathematica does not issue a warning when the calculations are losing so much precision that the results are not anymore useful?
  • Next by thread: why this system cannot be solved!