[SciPy-dev] test error on Solaris using Sun's compilers

Pearu Peterson pearu at cens.ioc.ee
Wed Sep 11 15:31:08 CDT 2002


Hi,

On Wed, 11 Sep 2002, Skip Montanaro wrote:

> I installed SciPy on a Solaris machine using Sun's C and Fortran compilers
> (hint for the unwary: this was *not* a straightforward exercise). 

(I hope that you will contribute your solutions also to scipy.)

> I manually executed the code in scipy.stats.morestats.shapiro, and got
> different results from the statlib.swilk call.  On the Sun I got:
> 
>     >>> scipy.stats.statlib.swilk(y,a[:N/2],init)
>     (array([ 0.47337097,  0.32174039,  0.25566325,  0.20829722,  0.16863985,  0.13358422,
>                  0.10147439,  0.07128929,  0.04232321,  0.01403512],'f'), 0.90047276020050049, 0.042089268565177917, 0)
> 
> On Linux I got:
> 
>     >>> scipy.stats.statlib.swilk(y,a[:N/2],init)
>     (array([ 0.47337109,  0.32174024,  0.25566328,  0.20829724,  0.16863985,  0.13358422,
>                  0.1014744 ,  0.0712893 ,  0.04232322,  0.01403512],'f'), 0.90047299861907959, 0.042089745402336121, 0)
> 
> I can try compiling the underlying Fortran file with different flags (no
> optimization for instance).  What else could/should I try?

No need. Note that swilk uses single precision floats and upto that
precision the results are identical. The difference in last relevant bits
of floats may be due to the difference how float operations are performed
under Sun and Linux. If I remember correctly, then with gcc
double-double operations are carried out with extra precision. The similar
usage of extra precision may be true for float-float operations.
It looks like the test codes need a fix, maybe decimal-=1.

Pearu




More information about the Scipy-dev mailing list