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/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result


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.


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