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/10716] various problems in cacosh and cacos


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

Richard B. Kreckel <kreckel at ginac dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kreckel at ginac dot de

--- Comment #1 from Richard B. Kreckel <kreckel at ginac dot de> 2011-11-23 08:45:16 UTC ---
(In reply to comment #0)
> The classical branch cut for cacosh() is (-inf, 1). However, cacosh() is using
> a different branch cut.

Branch cuts being standardized in C99 this is now a matter of conformance!

> cacosh(-1 + -0 I) -> (0 + 3.14159265358979 I)

After applying the patch attached to BZ #13305 the correct result 0 -
3.14159265358979*I is returned.

> cacos(1 + 0 I) -> (0 + 0 I) [should be (0 - O I)]

This is how cacos is computed by glibc:
cacos(x)
  ->  Pi/2 - casin(x)
  ->  Pi/2 - casinh(x I)/I
So, cacos(1 + 0 I) eventually ends up computing casinh(-O + I) which, in turn,
is computed using log(x+sqrt(1+x^2)). But that formula stands no chance getting
the sign of zero in the real part right along the strip running from -I to +I.
To fix it, it would have to be rewritten using a formula that computes the real
and the imaginary part completely independently.

> Finally the documentation of cacosh says that the real part of the result is
> chosen non-negative, which is clearly wrong on this example:
> 
> cacosh(-3.45677995681763 + -2.3456699848175 I) -> (-2.11780021549476 + 2.53187508681341 I)

This appears to have been fixed long ago with BZ #2153.

-- 
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]