This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/12786] New: cacosh sometimes returning wrong result for real values between -1 and 1


http://sourceware.org/bugzilla/show_bug.cgi?id=12786

           Summary: cacosh sometimes returning wrong result for real
                    values between -1 and 1
           Product: glibc
           Version: 2.12
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj@suse.de
        ReportedBy: bert.barbe@oracle.com


Created attachment 5738
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5738
test program

After the fix for http://sourceware.org/bugzilla/show_bug.cgi?id=2182
cacosh, cacoshf and cacoshl can return results with the wrong sign when
the argument is a real value between -1 and 1.
This is because due to rounding errors, the real part of the result is a small
negative value instead of 0. The fix for bz2182 will change the sign of the
result because the real part is negative.

Note that the formula w=clogf(z+ csqrtf(z+1) * csqrtf (z -1)) of other
implementations does give the correct sign right away.

Some examples on a x86_64 linux , Intel(R) Xeon(R) CPU  5160 ,
glibc-2.12-1.7.el6.x86_64:

*** z=-0.680000 + 0.000000*i   cacoshf(z)=+5.960464e-08  -2.318559e+00 *i
*** z=-0.670000 + 0.000000*i   cacoshf(z)=+5.960464e-08  -2.305006e+00 *i
*** z=-0.580000 + 0.000000*i   cacoshf(z)=+5.960464e-08  -2.189526e+00 *i
*** z=-0.570000 + 0.000000*i   cacoshf(z)=+5.960464e-08  -2.177303e+00 *i

Attached is a test program that will print the cacosh values for real arguments
between -1 and +1 , at interval 0.01 and indicate the results with a wrong sign
with "***"

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]