MathGroup Archive 2002

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

Search the Archive

Re: Accuracy and Precision

  • To: mathgroup at smc.vnet.net
  • Subject: [mg36983] Re: Accuracy and Precision
  • From: pkosta2002 at yahoo.com (Peter Kosta)
  • Date: Fri, 4 Oct 2002 05:01:21 -0400 (EDT)
  • References: <anggkb$prg$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

The more I play with the example the more depressing it gets. Start
with floating point numbers but explicitely arbitrary-precision ones.

In[1]:=
a=77617.00000000000000000000000000000;
b=33095.00000000000000000000000000000;

In[3]:=
\!\(333.7500000000000000000000000000000\ b\^6 + a\^2\ \((11\ a\^2\
b\^2 - \
b\^6 - 121\ b\^4 - 2)\) + 5.500000000000000000000000000000\ b\^8 +
a\/\(2\
            b\)\)

Out[3]=
\!\(\(-4.78339168666055402578083604864320577443814`26.6715*^32\)\)

In[4]:=
Accuracy[%]

Out[4]=
-6

Due to the manual section 3.1.6:

"When you do calculations with arbitrary-precision numbers, as
discussed in the previous section, Mathematica always keeps track of
the precision of your results, and gives only those digits which are
known to be correct, given the precision of your input. When you do
calculations with machine-precision numbers, however, Mathematica
always gives you a machine­precision result, whether or not all the
digits in the result can, in fact, be determined to be correct on the
basis of your input. "

Because I started with arbitrary-precision numbers Mathematica should display
only those digits that are correct, that is none.


To relax a bit, set a new input cell to StandardForm and type 
77617.000000000000000000000000000000000

Convert it to InputForm. You get
77616.999999999999999999999999999999999999999999952771`37.9031

Convert back to StandardForm
77616.99999999999999999999999999999999999999999976637`37.9031

Again to InputForm
77616.99999999999999999999999999999999999999999963735`37.9031

Back to StandardForm
77616.99999999999999999999999999999999999999999951376`37.9031

See what you can get if you have enough patience or a small program.

PK


  • Prev by Date: FW: Re: the fastest way to read binary files
  • Next by Date: Re: Loss of precision when using Simplify
  • Previous by thread: Re: Accuracy and Precision
  • Next by thread: Re: Re: Accuracy and Precision