Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Dave Arnett <darnett@as.arizona.edu>
To: axp-list@redhat.com
Subject: Re: SIGFPE error on exponential underflow in g77
Date: Mon, 08 Mar 1999 11:00:56 -0700	[thread overview]
Message-ID: <36E41058.6201@as.arizona.edu> (raw)
In-Reply-To: 36DF0303.15FB@as.arizona.edu

> 
> 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?
> 
> --

We have a solution (and a puzzle). First, thanks to all who responded
so quickly and relevantly; for a newbie like me this was an eye-opener.

Solution: link libffm or libcpml 

I first used libffm because of Joachim Wesner's clean description of
what to do, from

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

I also tried the compact portable math library, from

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

Both worked beautifully, and reduced my compute time to 70 percent
of the previous value. FYI, libffm was about 98 percent as fast as cpml,
on my code mix, without tuning.

Thus
	g77	default lib(-lm?) wrapper	SIGFPE
	gcc	-lm				OK
	g77	-lfmm		wrapper		OK
	g77	-cpml		wrapper		OK

So the puzzle is why it seems to be the interaction between
the g77 wrapper and lm which gives the error. I use "error" because for
the physics of my simulation, exp(- big number ) should --> zero; but I
agree with Greg Lindahl that it occasionally might be useful to know
when underflows happen, for algorithmic development.

Cheers,

Dave


  parent reply	other threads:[~1999-03-08 18:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-04 22:02 SIGFPE error on exponential underflow in g77 Dave Arnett
1999-03-04 22:40 ` Andrei A. Dergatchev
1999-03-04 22:56 ` Greg Lindahl
1999-03-04 23:06 ` Joachim Wesner
1999-03-05 13:11   ` Greg Lindahl
1999-03-05 15:57     ` Dave Arnett
1999-03-05 16:24       ` Greg Lindahl
1999-03-05 22:08         ` Phillip Ezolt
1999-03-05 22:56           ` Alpa Processor no longer Number one :( Aaron
1999-03-05 22:27             ` Alpa Processor no longer Number one, nonsense phoenix2063
1999-03-05 23:35               ` Ron Farrer
1999-03-06 17:46               ` Kevin.Brown
1999-03-06 19:02                 ` mgraffam
1999-03-06 21:21                   ` Joachim Wesner
1999-03-06 21:47                     ` mgraffam
1999-03-06 22:22                       ` Kevin
1999-03-08 10:20               ` Jochen Kuepper
1999-04-09 12:35                 ` Michael Wilhelm
1999-03-05 23:07             ` Alpa Processor no longer Number one :( Andrew Hobgood
1999-03-05 23:11             ` Greg Lindahl
1999-03-05 23:18             ` Ron Farrer
1999-03-06 14:28               ` Aaron
1999-03-06  0:02             ` Dan O'Reilly
1999-03-06  1:00             ` Guide to life, love, and Intel marketing techniques (Alpa Processor no longer...) Daniel J. Frasnelli
1999-03-08 11:24             ` Alpa Processor no longer Number one :( Phil Carmody
1999-03-07 22:00           ` SIGFPE error on exponential underflow in g77 Greg Lindahl
1999-03-08  6:51             ` Wes Bauske
1999-03-08 13:19               ` Greg Lindahl
1999-03-09  7:31               ` Neil Carlson
1999-03-08 20:23                 ` Wes Bauske
1999-03-08 21:26                   ` Joachim Wesner
1999-03-08 18:00 ` Dave Arnett [this message]
1999-03-08 18:31   ` Greg Lindahl
1999-03-08 19:30     ` Phillip Ezolt
1999-03-08 20:13       ` Greg Lindahl
1999-03-08 21:47         ` Phillip Ezolt
1999-03-08 21:58           ` Dave Arnett
1999-03-13 17:13           ` Richard Henderson
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