This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix ldbl-128 cos range reduction near pi/2 (bug 15429)
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 09 May 2013 15:56:47 -0400
- Subject: Re: Fix ldbl-128 cos range reduction near pi/2 (bug 15429)
- References: <Pine dot LNX dot 4 dot 64 dot 1305091922380 dot 29757 at digraph dot polyomino dot org dot uk>
On 05/09/2013 03:23 PM, Joseph S. Myers wrote:
> Bug 15429 is inaccuracy of ldbl-128 cos near pi/2. The cause is
> inaccurate range reduction in that area; I don't know why the code
> uses only 93 bits for the high part of pi/2, but you need at least 226
> bits to get reasonable accuracy there, and subtraction of a 113-bit
> high part is always going to be exact in the relevant range. This
> patch changes the code to use 113 bits for both high and low parts.
> Tested mips64 to confirm the large ulps no longer appear.
>
> Notes:
>
> (a) The low part y[1] of the reduced value may not be very accurate -
> for that, you'd need 339 bits - but the low part isn't particularly
> significant to the final result so this shouldn't increase errors by
> more than 1ulp.
>
> (b) I'm testing a similar patch for the ldbl-128ibm case (bug 15359).
>
> 2013-05-09 Joseph Myers <joseph@codesourcery.com>
>
> [BZ #15429]
> * sysdeps/ieee754/ldbl-128/e_rem_pio2l.c (c): Use 113 bits for
> high part of pi/2.
> (__ieee754_rem_pio2l): Update comments.
Thanks for tracking this down. This looks good to me.
Cheers,
Carlos.