Bug 14868 - ldbl-128ibm hypotl inaccurate for arguments differing by 2^60
Summary: ldbl-128ibm hypotl inaccurate for arguments differing by 2^60
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: 2.16
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-21 23:34 UTC by Joseph Myers
Modified: 2014-06-14 11:04 UTC (History)
0 users

See Also:
Host: powerpc*
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Myers 2012-11-21 23:34:13 UTC
The ldbl-128ibm implementation of hypotl returns a+b if the absolute values of the arguments have a ratio of over 2^60.  But while in such a case it's true that the round-to-nearest result will be the larger absolute value of an argument, a+b isn't the correct way to compute that result, and results in large errors until the ratio is over 2^106.  For example, hypotl (1.0L, 0x1p-61L) has a 17592186044416 ulp error (as computed using libm-test.inc).  This appears to be what's causing 16 ulp errors for csqrtl tests as well.
Comment 1 Joseph Myers 2012-11-22 15:03:25 UTC
Fixed for 2.17 by:

commit 8e27e3cc453849158e069dbed0eea7b8113ab8ff
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Nov 22 14:57:22 2012 +0000

    Fix ldbl-128ibm hypotl inaccuracy for arguments with large ratio (bug 14868).