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

Bug#210400: marked as done (libc6: generic log() is no longer exactly rounded (regression))



Your message dated Mon, 12 Dec 2005 17:56:24 +0100
with message-id <20051212165624.GB9953@dixsept.loria.fr>
and subject line libc6: generic log() is no longer exactly rounded (regression)
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 11 Sep 2003 07:54:52 +0000
>From vincent@vinc17.org Thu Sep 11 02:54:49 2003
Return-path: <vincent@vinc17.org>
Received: from smtp-104-thursday.noc.nerim.net (mallaury.noc.nerim.net) [62.4.17.104] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 19xMHw-0004vN-00; Thu, 11 Sep 2003 02:54:48 -0500
Received: from ay (vinc17.net1.nerim.net [62.4.18.82])
	by mallaury.noc.nerim.net (Postfix) with ESMTP
	id C80DA62D4F; Thu, 11 Sep 2003 09:54:46 +0200 (CEST)
Received: from lefevre by ay with local (Exim 3.36 #1 (Debian))
	id 19xMHt-0006kc-00; Thu, 11 Sep 2003 09:54:45 +0200
Date: Thu, 11 Sep 2003 09:54:44 +0200
From: Vincent Lefevre <vincent@vinc17.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libc6: generic log() is no longer exactly rounded (regression)
Message-ID: <20030911075444.GA25610@ay.nerim.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Reportbug-Version: 2.24
X-Mailer-Info: http://www.vinc17.org/mutt/
User-Agent: Mutt/1.5.4i
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0
	tests=BAYES_01,HAS_PACKAGE,USER_AGENT_MUTT
	version=2.53-bugs.debian.org_2003_8_27
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_8_27 (1.174.2.15-2003-03-30-exp)

Package: libc6
Version: 2.3.2-5
Severity: normal

(Filled as a normal bug since it is a regression.)

With libc6 2.3.1-16, the generic log() function (as used on the PowerPC)
seemed to be exactly rounded. This is no longer the case with 2.3.2-5
(see the test below, which worked with libc6 2.3.1-16).

I couldn't see anything about this problem in the changelog except:

2002-10-25  Roland McGrath  <roland@redhat.com>

        * math/math.h (M_LOG2El): Correct the value.
        From Stephen L Moshier <steve@moshier.net>.

but I don't know if this change is the cause of the regression.

File testlog.c:
------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

void out (double x, char *s)
{
  int exp;
  long long m;

  m = frexp (x, &exp) * 9007199254740992LL;
  printf ("%s = %-23.17g (mant: %lld/2^53, exp: %d)\n", s, x, m, exp);
}

int main (int argc, char *argv[])
{
  double x, y;

  if (argc != 2)
    {
      fprintf (stderr, "Usage: testlog <double>\n");
      exit (1);
    }

  x = atof (argv[1]);
  y = log (x);

  out (x, "     x");
  out (y, "log(x)");

  return 0;
}
------------------------------------------------------------------------

$ ./testlog 1.000000046697654
     x = 1.000000046697654       (mant: 4503599837678033/2^53, exp: 1)
log(x) = 4.6697652875585992e-08  (mant: 7056749784587155/2^53, exp: -24)

Maple gives:

> Digits := 40;
                                 Digits := 40

> evalf(log(4503599837678033/2^52)*2^(77));
                                                             16
                0.7056749784587155500000005883462666272941 10

The result is closer to 7056749784587156/2^53 than 7056749784587155/2^53.
So, log(x) should have returned a number equal to 7056749784587156/2^53.

-- System Information:
Debian Release: testing/unstable
Architecture: powerpc
Kernel: Linux ay 2.4.18-newpmac #1 Mon Jun 9 03:10:07 UTC 2003 ppc
Locale: LANG=C, LC_CTYPE=en_US.ISO8859-1

Versions of packages libc6 depends on:
ii  libdb1-compat                 2.1.3-7    The Berkeley database routines [gl

-- no debconf information

---------------------------------------
Received: (at 210400-done) by bugs.debian.org; 12 Dec 2005 16:56:26 +0000
>From vincent@vinc17.org Mon Dec 12 08:56:26 2005
Return-path: <vincent@vinc17.org>
Received: from dixsept.loria.fr ([152.81.9.195])
	by spohr.debian.org with esmtp (Exim 4.50)
	id 1ElqyQ-0000wV-4k
	for 210400-done@bugs.debian.org; Mon, 12 Dec 2005 08:56:26 -0800
Received: from vlefevre by dixsept.loria.fr with local (Exim 4.60)
	(envelope-from <vincent@vinc17.org>)
	id 1ElqyO-0004ub-DJ; Mon, 12 Dec 2005 17:56:24 +0100
Date: Mon, 12 Dec 2005 17:56:24 +0100
From: Vincent Lefevre <vincent@vinc17.org>
To: 210400-done@bugs.debian.org
Subject: Re: libc6: generic log() is no longer exactly rounded (regression)
Message-ID: <20051212165624.GB9953@dixsept.loria.fr>
References: <20030911075444.GA25610@ay.nerim.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20030911075444.GA25610@ay.nerim.net>
X-Mailer-Info: http://www.vinc17.org/mutt/
User-Agent: Mutt/1.5.11-vl-20051124
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2005_01_02

On 2003-09-11 09:54:44 +0200, Vincent Lefevre wrote:
> Package: libc6
> Version: 2.3.2-5
> Severity: normal
> 
> (Filled as a normal bug since it is a regression.)
> 
> With libc6 2.3.1-16, the generic log() function (as used on the PowerPC)
> seemed to be exactly rounded. This is no longer the case with 2.3.2-5
> (see the test below, which worked with libc6 2.3.1-16).

I've just tested it again on the same machine with libc6 2.3.5-8 and
I no longer get this problem. As reported on

        http://www.vinc17.org/research/testlibm/

the log now seems to be correctly rounded, as with libc6 2.3.1-16.
So, I'm closing the bug.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA



Reply to: