public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/12786] New: cacosh sometimes returning wrong result for real values between -1 and 1
@ 2011-05-19 15:49 bert.barbe at oracle dot com
  2011-05-20 13:31 ` [Bug math/12786] " bert.barbe at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bert.barbe at oracle dot com @ 2011-05-19 15:49 UTC (permalink / raw)
  To: glibc-bugs

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-27 13:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-19 15:49 [Bug math/12786] New: cacosh sometimes returning wrong result for real values between -1 and 1 bert.barbe at oracle dot com
2011-05-20 13:31 ` [Bug math/12786] " bert.barbe at oracle dot com
2011-05-20 14:47 ` carlos at codesourcery dot com
2011-06-09 15:18 ` carlos at systemhalted dot org
2011-11-23  9:05 ` kreckel at ginac dot de
2011-12-23 15:59 ` drepper.fsp at gmail dot com
2011-12-23 16:03 ` drepper.fsp at gmail dot com
2014-06-27 13:20 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).