From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 20905 invoked from network); 7 Jan 1999 01:27:16 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 7 Jan 1999 01:27:16 -0000 Received: from beach.frankfurt.netsurf.de (root@beach.frankfurt.netsurf.de [194.64.181.2]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id UAA12795 for ; Wed, 6 Jan 1999 20:07:57 -0500 Received: from Othello ([194.195.95.59]) by beach.frankfurt.netsurf.de (8.8.5/8.8.5) with SMTP id CAA07148 for ; Thu, 7 Jan 1999 02:07:54 +0100 (MET) From: Joachim Wesner To: axp-list@redhat.com Subject: Re: Problem with floating point exceptions Date: Thu, 7 Jan 1999 02:06:05 +0100 X-Mailer: KMail [version 0.7.9] Content-Type: text/plain References: <3693DC48.155A662A@nist.gov> MIME-Version: 1.0 Message-Id: <99010702103700.01905@Othello> Content-Transfer-Encoding: quoted-printable On Wed, 06 Jan 1999, Adam C. Powell, IV wrote: >John Montgomery wrote:=0D >=0D >> II get floating=0D >> point exceptions in sections of the code which evaluate exp(-x) for la= rge=0D >> positive values of x. This is normal behavior and on other platforms=0D >> results in underflows, which are silently set to zero.=20 >>=0D >> I'd like to just have these cases underflow to zero without generating= =0D >> exceptions, does anyone know how to make this happen?=0D >=0D >I'm not positive, but I think libffm 0.28 gives the behavior you want, a= nd=0D >it is several times faster than libm, let alone with -mieee. Just downl= oad,=0D >build, and link your code -lffm -lm.=0D > =0D Yes, libffm now works that way that it (should) never return denormalized numbers as the result of calculation, HOWEVER, in the current implementat= ion, for the functions that are "identity" for very small args x, where sin(x)= =3D tan(x) =3D asin(x) =3D atan(x), also the same denormalized number is retu= rned=20 that enters the routine. Probably, in the next release I will add a compile time option to "fix" t= hese arguments by returning zero here instead, so libffm will do some "healing action" on bad args. Nevertheless, for exp, already in the current version, NO denorms are returned for too negative args, 0 is returned instead. Joachim Wesner