public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result
@ 2011-10-17  8:39 kreckel at ginac dot de
  2011-10-29 20:17 ` [Bug math/13305] " kreckel at ginac dot de
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: kreckel at ginac dot de @ 2011-10-17  8:39 UTC (permalink / raw)
  To: glibc-bugs

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

             Bug #: 13305
           Summary: cacosh(+/-0.5+0.0*i) returns wrong result
           Product: glibc
           Version: 2.14
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj@suse.de
        ReportedBy: kreckel@ginac.de
    Classification: Unclassified


Created attachment 6007
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6007
patch

The current implementation computes cacosh(0.5+0.0*o)=0.0-1.047*i and
cacosh(-0.5+0.0*i)=0.0-2.094*i. But that result has the wrong sign.

Wes Loewer's patch for BZ#2182 was wrongly applied and should be reverted. The
patch tried to fix the choice of branch cut by inverting res, if Re(res)<0.0.
This is okay for picking the right branch cut but it suffers to the problem
that round-off errors might have occurred in the computation of res. A safer
approach is checking the position of the actual argument z. Indeed, the current
implementation is doing just that a few lines above, but I don't see this in
BZ#2182! Removing the extra test fixes the case.

Impact: A different result is computed only when res, as computed so far, has a
negative real part. But a negative real part of res can only happen due to
round-off errors, as mathematically the argument of log is bounded below by
+1.0.

-- 
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 11:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-17  8:39 [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result kreckel at ginac dot de
2011-10-29 20:17 ` [Bug math/13305] " kreckel at ginac dot de
2011-11-19 22:19 ` kreckel at ginac dot de
2011-11-19 22:21 ` kreckel at ginac dot de
2011-12-19  9:37 ` aj at suse dot de
2011-12-22  2:03 ` drepper.fsp at gmail dot com
2011-12-23 16:04 ` drepper.fsp at gmail dot com
2014-06-27 11:51 ` 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).