Fix ldbl-128 cos range reduction near pi/2 (bug 15429)

Carlos O'Donell carlos@redhat.com
Thu May 9 19:56:00 GMT 2013


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.



More information about the Libc-alpha mailing list