This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix catan, catanh inaccuracy through use of log (bug 15394)
- From: Andreas Jaeger <aj at suse dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 24 Apr 2013 20:13:49 +0200
- Subject: Re: Fix catan, catanh inaccuracy through use of log (bug 15394)
- References: <Pine dot LNX dot 4 dot 64 dot 1304241640480 dot 16169 at digraph dot polyomino dot org dot uk>
On 04/24/2013 06:42 PM, Joseph S. Myers wrote:
Bug 15394 is inaccuracy of catan and catanh for certain arguments
where they involve computing log of a number close to 1 (or in the
case of catanh, subtracting logs of similar arguments, which could
lead to worse results in some cases than computing the log of their
ratio, through large cancellation even when the ratio isn't that close
to 1).
This patch fixes this inaccuracy by using log1p except in the cases
where log of a number close to 0 is involved, when use of log1p of a
number close to -1 would yield worse results than log and so log of a
ratio is used instead.
Tested x86_64 and x86 and ulps updated accordingly.
Thanks, this is ok,
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126