Bug 15416 - catan, catanh inaccuracy from atan2
Summary: catan, catanh inaccuracy from atan2
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: 2.17
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-29 16:25 UTC by Joseph Myers
Modified: 2014-06-13 18:10 UTC (History)
0 users

See Also:
Host:
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 2013-04-29 16:25:54 UTC
When catan computes __real__ res = 0.5 * __ieee754_atan2 (2.0 * __real__ x, den), the value of den may be inaccurate when close to 0, resulting in an inaccurate real part of the result when __real__ x is also small.  For example, catan (0x1p-27 + 1.0i) gives a result with real part 0.785398163397448279 on x86_64, which is only accurate to 8 decimal places, about half the precision expected (the exact value is 0.785398165260093458846617868453411006955...).  The same applies to catanh.
Comment 1 Joseph Myers 2013-04-30 11:30:20 UTC
Fixed for 2.18 by:

commit caf84319c1614d8aa867d8db80219f4e9b1bf735
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Apr 30 11:27:35 2013 +0000

    Fix catan, catanh inaccuracy from atan2 denominators near 0 (bug 15416).