From: jim@lime.rsmas.miami.edu (Jim Brown)
Subject: WARNING: Severe error in sincos RTL primative (OSF/1 v2.0+)
Date: 26 Apr 1994 16:42:08 -0400 [thread overview]
Message-ID: <2pjub0$q25@lime.rsmas.miami.edu> (raw)
The following short FORTRAN program (if compiled -O or -O2/better)
demonstrates a SEVERE bug in the OSF/1 runtime library (libm) used by FORTRAN.
[Optimization levels O2 and above collapse occurrences of the SIN and
COS of the same argument into one RTL call to the routine "sincos(x)"
which returns both values.]
program a
real*8 x, y, z
real*8 colat, lon, lat
lat = -75d0
colat = 90d0-lat
do lon=-169d0,-172d0,-1d0
x = dcosd(LON)*dsind(COLAT)
y = dsind(LON)*dsind(COLAT)
print *,sngl(lat),sngl(lon),sngl(x),sngl(y)
end do
end
Example of bad results (seen on both OSF/1 v1.3, rev 111 and
OSF/1 v2.0, rev 240 (and 'FT after v2.0', rev 248.1) using either
f77 t3.4 or f77 v3.4):
LAT LON X Y
-75.00000 -169.0000 -0.2540638 -4.9385004E-02
-75.00000 -170.0000 -0.2548870 -4.4943456E-02
-75.00000 -171.0000 0.2556325 -4.0488217E-02
-75.00000 -172.0000 0.2563002 -3.6020648E-02
Notice that X loses its '-' sign. A similar result obtains for LON
between +169 and +172.
This bug has been reported to DEC (FT QARs 21221/21222).
Jim Brown, U Miami, jim@lime.rsmas.miami.edu
--
Jim Brown, University of Miami, RSMAS/MPO
[send mail to jim@lime.rsmas.miami.edu]
reply other threads:[~1994-04-26 20:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox