[8121] in Athena Bugs

home help back first fref pref prev next nref lref last post

decmips 7.3M: f77

daemon@ATHENA.MIT.EDU (ellis@ATHENA.MIT.EDU)
Fri Sep 6 16:02:32 1991

From: ellis@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Cc: nschmidt@ATHENA.MIT.EDU
Date: Fri, 06 Sep 91 16:02:36 EDT

System name:		m33-222-9
Type and version:	KN01 7.3M
Display type:		PMAX-MFB

What were you trying to do?
        Compile and run Numerical Recipes Library

What's wrong:
        DEC has seriously screwed up floating point exception handling in
        DEC Fortran 3.0. Consider the following example cut from
        a Numerical Recipes program. 

        data am,x,s,y/ 9.000000,133.8781,4.358899,28.64901/
c        data am,x,s,y/   9.000000,242.1776,4.358899,53.49461/
        x1 =AM*LOG(X/AM)-S*Y
        t3 = EXP(X1)
        write(6,*) x1,t3
 100    stop
        end



What should have happened:
        In this example, the value of the exponent is -100.58, so e^(-100.58)
   should produce a floating underflow. What actually happens depends on 
   the compilation option:

     a) When compiled with "f77 tmp1.f", this program runs to completion,
     and prints out a value that is supposed to be outside the range of
     a real number( min value ~10^-38):

             -100.5808      2.1019477E-44

     b) When compiled with no optimization, "f77 -O0 tmp1.f" a floating 
     overflow message and program termination result:
       
              forrtl: error: floating overflow
              Illegal instruction

     In addition, this behabvior is not consistent for all values.
     The commented out data, does not produce any problem for the example
     regardless of compilation option. The result is that e^y (exp) produces
     floating overflow for only some values of y.



home help back first fref pref prev next nref lref last post