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

Re: Problem with floating point exceptions



John Montgomery wrote:

> I'm trying to port a large Fortran program to alpha Linux using f2c/gcc.
> My system is a UDB running RedHat 5.1.  I'm able to compile and run my
> code, but I'm having some strange numerical problems.  I get floating
> point exceptions in sections of the code which evaluate exp(-x) for large
> positive values of x.  This is normal behavior and on other platforms
> results in underflows, which are silently set to zero.  Also, when I poke
> around in core dumps with gdb I find numbers with exponents less than
> -308, which seem like they should have overflowed already.  Perhaps these
> somehow got unnormalized?
>
> I'd like to just have these cases underflow to zero without generating
> exceptions, does anyone know how to make this happen?

I'm not positive, but I think libffm 0.28 gives the behavior you want, and
it is several times faster than libm, let alone with -mieee.  Just download,
build, and link your code -lffm -lm.

http://people.frankfurt.netsurf.de/Joachim.Wesner/

Zeen,

-Adam `Cold Fusion' Powell, IV http://www.ctcms.nist.gov/~powell/ ____
USDoC, National Institute of Standards & Technology (NIST)  |\ ||<  |
Center for Theoretical and Computational Materials Science  | \||_> |





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