[SciPy-User] understanding machine precision

Francesc Alted faltet@pytables....
Tue Dec 14 12:09:03 CST 2010


A Tuesday 14 December 2010 18:42:40 josef.pktd@gmail.com escrigué:
> I thought that we get deterministic results, with identical machine
> precision errors, but I get (with some random a0, b0)
> 
> >>> for i in range(5):
> 	x = scipy.linalg.lstsq(a0,b0)[0]
> 	x2 = scipy.linalg.lstsq(a0,b0)[0]
> 	print np.max(np.abs(x-x2))
> 
> 
> 9.99200722163e-016
> 9.99200722163e-016
> 0.0
> 0.0
> 9.99200722163e-016
> 
> >>> a0.shape
> 
> (100, 10)
> 
> >>> b0.shape
> 
> (100, 3)
> 
> Why is the result not always the same? just curious

That's really funny!  Could you please come up with a self-contained 
example so as to see if others can reproduce that?

-- 
Francesc Alted


More information about the SciPy-User mailing list