From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 7514 invoked from network); 6 Jan 1999 22:06:26 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 6 Jan 1999 22:06:26 -0000 Received: from ares.cs.Virginia.EDU (ftp.cs.Virginia.EDU [128.143.137.19]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id QAA03680 for ; Wed, 6 Jan 1999 16:47:11 -0500 Received: from mamba.cs.virginia.edu (mamba.cs.Virginia.EDU [128.143.137.15]) by ares.cs.Virginia.EDU (8.8.5/8.8.5) with ESMTP id QAA28150 for ; Wed, 6 Jan 1999 16:47:10 -0500 (EST) From: Greg Lindahl Received: (from lindahl@localhost) by mamba.cs.virginia.edu (8.7.5/8.7.3) id QAA22418 for axp-list@redhat.com; Wed, 6 Jan 1999 16:47:09 -0500 (EST) Message-Id: <199901062147.QAA22418@mamba.cs.virginia.edu> Subject: Re: Problem with floating point exceptions To: axp-list@redhat.com Date: Wed, 6 Jan 1999 16:47:09 -0500 (EST) In-Reply-To: <3693D5C9.786F9302@hamster.lorentzian.com> from "John Montgomery" at Jan 6, 99 09:29:45 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > 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