From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 9E5B42FBF1 for ; Mon, 26 Feb 2001 07:50:29 -0500 (EST) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f1QCpDR14236 for axp-list@listman.redhat.com; Mon, 26 Feb 2001 07:51:13 -0500 Received: from mgate2.uni-hannover.de (zzismail@mgate2.uni-hannover.de [130.75.2.5]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f1QCpD414232 for ; Mon, 26 Feb 2001 07:51:13 -0500 Received: from wega.itp.uni-hannover.de by mgate2.uni-hannover.de with LocalSMTP (PP) with ESMTP; Mon, 26 Feb 2001 13:49:34 +0100 Received: from capella.itp.uni-hannover.de (capella.itp.uni-hannover.de [130.75.25.93]) by wega.itp.uni-hannover.de (AIX4.3/UCB 8.8.8/8.8.8) with ESMTP id NAA16430; Mon, 26 Feb 2001 13:49:33 +0100 Received: (from kreutzm@localhost) by capella.itp.uni-hannover.de (8.9.3/8.9.3) id NAA20757; Mon, 26 Feb 2001 13:49:33 +0100 Date: Mon, 26 Feb 2001 13:49:33 +0100 From: Helge Kreutzmann To: AXP-Liste Cc: Lukas Dobrek Subject: exp underflow in glibc and compaq math library/kernel bug ? Message-ID: <20010226134933.A20708@itp.uni-hannover.de> Mail-Followup-To: AXP-Liste , Lukas Dobrek User-Agent: Mutt/1.2.5i X-Public-Key-URL: http://www.itp.uni-hannover.de/~kreutzm/data/kreutzm.gpg X-homepage: http://www.itp.uni-hannover.de/~kreutzm MIME-version: 1.0 Content-type: text/plain; charset="iso-8859-1" Content-transfer-encoding: 8bit Content-Disposition: inline X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: Hello ! A collegue of mine ran into a possible bug in glibc on alpha and asked me to post the description here: ----- Forwarded message from Lukas Dobrek ----- > Hello, > I have following problem. I dont really know where the bug is, it > is either in the implementation of the exp function in glibc and > compaq math library or in the kernel. Let me cut to the case. Look > at this small code: > > #include > int main(void) > { > double x; > x=exp(-744.769); > x/=2.0; > printf("%g\n",x); > return(0); > } > > Compilation with gcc and linking with libm from glibc-2.2.1 gives a > floating point exception immediately. With compaq math library or > compaq C compiler it is not so easy but it is also possible to get a > FPE, one has to play with numbers. Why is it so? The problem is > that exp(-744) is out of the double precision range. But > implementation of exp in glibc does not set it to 0 but keep the > underflow. This is a part of > glibc-2.2.1/sysdeps/ieee754/dbl-64/e_exp.c > > /* Exceptional cases: */ > else if (isless (x, himark)) > { > if (__isinf (x)) > /* e^-inf == 0, with no error. */ > return 0; > else > /* Underflow */ > return TWOM1000 * TWOM1000; > } > else > return TWO1023*x; > > I dont know why this underflow is kept here. But it is not a simple > mistake. So probably the problem is somehow related to math-emu in > kernel. I testied it only with 2.2.x kernels. I dont feel like > switching to 2.4.x series now. But IMO something is very wrong. > Now the question to whome I should report the problems. Is this a > good place? > > Best Regards > Lukasz > > -- > Lukasz Dobrek > Institut für Theoretische Physik > Appelstraße 2, 30167 Hannover, Germany > e-mail:dobrek@itp.uni-hannover.de ----- End forwarded message ----- Thanks Helge -- Helge Kreutzmann, Dipl.-Phys. kreutzm@itp.uni-hannover.de For gpg-key: finger kreutzm@rigel.itp.uni-hannover.de 64bit GNU powered http://www.itp.uni-hannover.de/~kreutzm Help keep free software "libre": http://www.freepatents.org/