[Numpy-discussion] Question: why is this different?

meng at are.berkeley.edu meng at are.berkeley.edu
Tue Oct 18 13:28:40 EDT 2005

Todd and Paul-

Thank you so much for your help! Any suggestions on my next step? This 
difference doesn't make my result qualitatively different but my final 
result differs in the 3rd decimal point across these two machines, which 
could be troublesome when you want something that's robust to these 
computing errors.


At 18:10 2005-10-17 -0400, Todd Miller wrote:
>meng at are.berkeley.edu wrote:
>>Hi there-
>>I have a question on how this difference arises when I run the following 
>>simple code on windows and Debian:
>> >>> from numarray import *
>> >>> a=reshape(arange(81.0), (9,9))+identity(9)
>> >>> ca = matrixmultiply(transpose(a),a)
>> >>> import numarray.linear_algebra as la
>> >>> ica = la.inverse(ca)
>> >>> ica.min()
>> >>> ica.max()
>>The above is the result in Debian and below is that in Windows:
>> >>> ica.min()
>> >>> ica.max()
>I'm able to reproduce your "Windows results" in Fedora Core 4 x86_64... 
>exactly.   That says that a variant of gcc and VC.NET are producing 
>identical results to 18 digits... which is encouraging.  Numeric agrees as 
>When I build numarray with LAPACK and ATLAS rather than the builit-in 
>lapack_lite on RHEL3 i386 I get different results from any of the above:
>ica.min: -0.30951621414375136
>ica.max: 0.88889185865854037
>They are closest to Debian I think, differing in the 15th decimal 
>place.    My suspicion is that your Debian version is being built against 
>different numerical libraries...  but I'm not privy to exactly how.  A key 
>point is that numarray on Windows is *not* built using LAPACK and ATLAS.
>>So, what caused this difference (both machines have python2.4 and 
>>numarray 1.3.2)? The difference happens in the 10th/11th decimal point, 
>>which should be still in the floating point precision, right?
>I would expect so.


Xiangyi Meng
Department of Agricultural and Resource Economics
Room 303, Giannini Hall #3310
University of California, Berkeley
Berkeley, CA 94720-3310
Tel:  (510) 643-4124
Fax: (510) 643-8911
Email: meng at are.berkeley.edu

More information about the NumPy-Discussion mailing list