[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

SIN/COS broken in gfortran on mipsel? Test request

Dear list,

I find it hard to believe, but it seems that the SIN() and COS()
built-ins might be broken in gfortran on mipsel.  See this build log for
instance, search in it for the string "Testing Routine B101" and look at
the table following that string:


Judging by this build log, the SIN(x) and COS(x) functions on mipsel
apparently return 0 and 1 respectively for x > 0 (and do not give the
right values even for x = 0).

Unfortunately, as far as I know there are no currently available
mips/mipsel machines for developers to use, so I need to ask this list
for help.  I'm attaching a stand-alone version of this test as file
"sincos.F".  If someone running the latest Sid on a mipsel architecture
wouldn't mind, please install the latest gfortran-4.3 package, run the
following and see what you get:

gfortran-4.3 -O2 sincos.F -o a.out

What you *should* get is something like the following: (obviously the
exact errors will vary depending on floating point variations, but
should be less than 1.0E-07)

        For A=I*PI/180:

     I   X=SIN(A)    Y=COS(A)        ATG(X,Y)    Error
     0   0.0000000   1.0000000      0.0000000   0.0E+00
    10   0.1736482   0.9848077      0.1745329   0.9E-07
    20   0.3420202   0.9396926      0.3490659   0.0E+00
       Largest Error for ATG was   0.9E-07

If the same bug as seen in the cernlib build log manifests itself, you
will get something more like this:

        For A=I*PI/180:

     I   X=SIN(A)    Y=COS(A)        ATG(X,Y)    Error
     0   0.9869969   0.1607389      1.4093571   0.0E+00
    10   0.0000000   1.0000000      0.0000000   0.1E+01
    20   0.0000000   1.0000000      0.0000000   0.1E+01
       Largest Error for ATG was   0.1E+01

Please let me know (CC: to my email address) what is actually obtained
on mipsel (and also on big-endian mips if possible).

If you do get results significantly different from those shown above,
please try compiling at lower optimization levels down to -O0 and see
whether any of them give the correct results.

Thank you and best regards,

Kevin B. McCarty <kmccarty@gmail.com>
WWW: http://www.starplot.org/
WWW: http://people.debian.org/~kmccarty/
GPG: public key ID 4F83C751
      PROGRAM B101M

C     Specify the largest error allowed for a successful test

      WRITE(6,'(/8X,''For A=I*PI/180:'')')
     +                 ''ATG(X,Y)'',4X,''Error'')')
      PI = 3.14159 26535 89793D0
      DO 1 I = 0,350,10
      IF (A .NE. 0.)ER=ABS((R1-A)/A)
      WRITE(6,'(1X,I5,2F12.7,F15.7,E10.1)') I,X1,X2,R1,ER
      WRITE(6,'(/7X,''Largest Error for ATG was'',E10.1)')ERMAX


      PARAMETER (PI = 3.14159 26535 89793D0)


Attachment: signature.asc
Description: OpenPGP digital signature

Reply to: