[Numpy-discussion] Different results from repeated calculation

Keith Goodman kwgoodman at gmail.com
Mon Jan 29 14:00:35 CST 2007


On 1/29/07, Keith Goodman <kwgoodman at gmail.com> wrote:
> On 1/29/07, Keith Goodman <kwgoodman at gmail.com> wrote:
> > On 1/29/07, Keith Goodman <kwgoodman at gmail.com> wrote:
> > > On 1/29/07, Charles R Harris <charlesr.harris at gmail.com> wrote:
> > >
> > > > That's odd, the LSB bit of the  double precision mantissa is only about
> > > > 2.2e-16, so  you can't *get* differences as  small as 8.4e-22 without about
> > > > 70 bit mantissa's. Hmmm, and extended double precision only has 63 bit
> > > > mantissa's. Are you sure you are computing the error correctly?
> > >
> > > That is odd.
> > >
> > > 8.4e-22 is just the output of the test script: abs(z - z0).max(). That
> > > abs is from python.
> >
> > By playing around with x and y I can get all sorts of values for abs(z
> > - z0).max(). I can get down to the e-23 range and to 2.2e-16. I've
> > also seen e-18 and e-22.
>
> Here is a setting for x and y that gives me a difference (using the
> unit test in this thread) of 4.54747e-13! That is huge---and a serious
> problem. I am sure I can get bigger.
>
>     # x data
>     x = M.zeros((3,3))
>     x[0,0] =  9.0030140479499
>     x[0,1] =  9.0026474226671
>     x[0,2] = -9.0011270502873
>     x[1,0] =  9.0228605377994
>     x[1,1] =  9.0033715311274
>     x[1,2] = -9.0082367491299
>     x[2,0] =  9.0044783987583
>     x[2,1] =  0.0027488028057
>     x[2,2] = -9.0036113393360
>
>     # y data
>     y = M.zeros((3,1))
>     y[0,0] =10.00088539878978
>     y[1,0] = 0.00667193234012
>     y[2,0] = 0.00032472712345

OK. I guess I should be looking at the fractional difference instead
of the absolute difference. The fractional difference is of order
e-16.


More information about the Numpy-discussion mailing list