From: Greg Lindahl <lindahl@cs.virginia.edu>
To: axp-list@redhat.com
Subject: Re: Problem with floating point exceptions
Date: Wed, 6 Jan 1999 16:47:09 -0500 (EST) [thread overview]
Message-ID: <199901062147.QAA22418@mamba.cs.virginia.edu> (raw)
In-Reply-To: <3693D5C9.786F9302@hamster.lorentzian.com> from "John Montgomery" at Jan 6, 99 09:29:45 pm
> 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.
FAQ. You need to use the -mieee flag in order to use denormalized
numbers at all. Unfortunately, the current exp() and other routines
will crash otherwise; ideally they should underflow to zero if you do
not specify -mieee.
Note that -mieee will slow down your code by a factor of 2 or more.
> I'd like to just have these cases underflow to zero without generating
> exceptions, does anyone know how to make this happen?
As a workaround, you can figure out the smallest value for which exp()
does not crash, and explicitly test for it in your code.
-- g
next prev parent reply other threads:[~1999-01-06 22:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-01-06 21:29 Problem with floating point exceptions John Montgomery
1999-01-06 21:47 ` Greg Lindahl [this message]
1999-01-06 23:23 ` Michal Jaegermann
1999-01-07 10:19 ` John Connett
1999-01-06 21:57 ` Adam C. Powell, IV
1999-01-07 1:06 ` Joachim Wesner
1999-01-07 15:54 ` Samba Izaak Bozof
1999-01-07 16:53 ` Samba feedback
1999-01-07 16:56 ` Samba Michal Jaegermann
1999-01-07 17:57 ` Samba Maurice Hilarius
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