This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix ldbl-128ibm coshl spurious overflows (bug 16407)
- From: Andreas Jaeger <aj at suse dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Date: Tue, 07 Jan 2014 22:37:46 +0100
- Subject: Re: Fix ldbl-128ibm coshl spurious overflows (bug 16407)
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1401072128550 dot 27342 at digraph dot polyomino dot org dot uk>
On 01/07/2014 10:29 PM, Joseph S. Myers wrote:
> This patch fixes bug 16407, spurious overflows from ldbl-128ibm coshl.
> The implementation assumed that a high part (reinterpreted as an
> integer) of the absolute value of the argument of 0x408633ce8fb9f87dLL
> or more meant overflow, but the actual threshold has high part
> 0x408633ce8fb9f87eLL (and a negative low part). The patch adjusts the
> threshold accordingly.
>
> sinhl probably has the same issue, but I didn't get that far in adding
> tests of special cases (such as just below and above overflow) before
> the freeze and during the freeze is not a suitable time to add them
> (as they'd require ulps to be regenerated again), so I'm not changing
> that function for now; when I add more tests of special cases, we'll
> discover whether sinhl indeed has this problem.
Ok, thanks,
Andreas
> Tested powerpc32.
>
> 2014-01-07 Joseph Myers <joseph@codesourcery.com>
>
> [BZ #16407]
> * sysdeps/ieee754/ldbl-128ibm/e_coshl.c (__ieee754_coshl):
> Increase overflow threshold.
>
> diff --git a/sysdeps/ieee754/ldbl-128ibm/e_coshl.c b/sysdeps/ieee754/ldbl-128ibm/e_coshl.c
> index 05683bc..92313e2 100644
> --- a/sysdeps/ieee754/ldbl-128ibm/e_coshl.c
> +++ b/sysdeps/ieee754/ldbl-128ibm/e_coshl.c
> @@ -69,7 +69,7 @@ __ieee754_coshl (long double x)
> if (ix < 0x40862e42fefa39efLL) return half*__ieee754_expl(fabsl(x));
>
> /* |x| in [log(maxdouble), overflowthresold] */
> - if (ix < 0x408633ce8fb9f87dLL) {
> + if (ix < 0x408633ce8fb9f87fLL) {
> w = __ieee754_expl(half*fabsl(x));
> t = half*w;
> return t*w;
>
--
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