Bug 2154 - accuracy of cacoshl is bad.
Summary: accuracy of cacoshl is bad.
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-15 18:02 UTC by Andreas Jaeger
Modified: 2018-04-19 14:04 UTC (History)
1 user (show)

See Also:
Host: x86_64-linux-gnu
Target: x86_64-linux-gnu
Build: x86_64-linux-gnu
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Jaeger 2006-01-15 18:02:14 UTC
Adding these tests to math/libm-test.inc's cacosh_test gives upto 770 ULPs for
the long double tests:

  TEST_c_c (cacosh, 0.3, 0.4, 0.405112337178030872507338405200229579L,
1.29016676450309079292712537938218583L);
  TEST_c_c (cacosh, -0.3, 0.4, 0.405112337178030872507338405200229579L,
1.85142588908670244553551800389731705L);
  TEST_c_c (cacosh, 0.3, -0.4, 0.405112337178030872507338405200229579L,
-1.29016676450309079292712537938218583L);
  TEST_c_c (cacosh, -0.3, -0.4, 0.405112337178030872507338405200229579L,
-1.85142588908670244553551800389731705L);

the float and double tests pass, just long double has this problem.
Comment 1 Ulrich Drepper 2006-04-25 18:43:08 UTC
Suspended until somebody comes up with a patch.
Comment 2 Joseph Myers 2012-02-22 22:22:26 UTC
The tests given in this bug take the double constants 0.3 and 0.4 and convert them to long double.  The results of cacoshl appear to be within a few ULPs of what is expected for those particular long double values, whereas the expectations given in this testcase are the results for infinite-precision constants 0.3 and 0.4 (as opposed to those for values rounded to 53 bits then extended to 64 bits, or rounded directly to 64 bits) - and when your inputs differ by 11 bits from what they were intended to be, 770 ULPs is hardly an unexpected error.  So this is not a correct test and there is no sign of undue inaccuracy here (I don't think it's yet expected for complex functions to be last-bit-accurate correctly rounded).