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

Re: SIGFPE error on exponential underflow in g77



Dave Arnett wrote:
> 
> Hardware: Alpha, Aspen Systems Durango II, Samsung 21164A-533
> Software: RH 5.2 (alpha), egcs-1.0.3, version 2.90.29
> 
> Can someone please tell me exactly where to find information on
> dealing with the following problem?
> 
> g77 dumps core upon giving the exponential function a value less than
> -708 (double precision). However it politely sets to zero a product
> which underflows.
> 
> f2c behaves the same.
> 
> Code in C which performs the same mathematics, using gcc with the same
> hardware, quietly sets the underflow from the exponential function
> to zero. (No, I cannot rewrite all the code in C in a finite time).
> 
> On an intel, RH 5.1, the exponential function politely goes to zero on
> underflow, as I would like.
> 
> I compiled and installed a newer release, egcs-1.1.1 version 2.91.60,
> which gave the same behavior.
> 
> How can I modify this behavior upon exponential underflow?
> 


Andrei A. Dergatchev wrote:
> 

> It must go to FAQ already :-)
> 
> I'd suggest you to look in the list archives like at
> http://www.lib.uaa.alaska.edu/axp-list/
> 
> (for example check a thread starting from here:
> http://www.lib.uaa.alaska.edu/axp-list/archive/1999-02/0562.html)
> As far as I get the problem there is no complete solution yet
> but -mieee in a proper enviroment must take care about it.


If you can really isolate this problem to the case when using exp, you
don't need to go back to -mieee (which slows down your code quite a
bit), but simply need a new math library.


Try to link with libffm (i.e. -lffm, but first you have to make the
library) from

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

(Sorry, there are noew some dynamic library version make files of it out
there, it's not yet updated)


or even use the brand new, faster, better, larger (?) free Compaq
(formerly DEC) libm from

	http://www.unix.digital.com/linux/cpml.0.1.tar.gz


Those should take care of the overflow probs and even speed up your
program



Joachim



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