1 .\" Copyright 2002 Walter Harms(walter.harms@informatik.uni-oldenburg.de)
2 .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
5 .\" Distributed under GPL
8 .TH CACOSH 3 2021-03-22 "" "Linux Programmer's Manual"
10 cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine
13 .B #include <complex.h>
15 .BI "double complex cacosh(double complex " z );
16 .BI "float complex cacoshf(float complex " z );
17 .BI "long double complex cacoshl(long double complex " z );
22 These functions calculate the complex arc hyperbolic cosine of
24 If \fIy\ =\ cacosh(z)\fP, then \fIz\ =\ ccosh(y)\fP.
27 is chosen in the interval [\-pi,pi].
30 is chosen nonnegative.
35 cacosh(z) = 2 * clog(csqrt((z + 1) / 2) + csqrt((z \- 1) / 2))
38 These functions first appeared in glibc in version 2.1.
40 For an explanation of the terms used in this section, see
48 Interface Attribute Value
53 T} Thread safety MT-Safe
59 C99, POSIX.1-2001, POSIX.1-2008.
62 /* Link with "\-lm" */
70 main(int argc, char *argv[])
72 double complex z, c, f;
75 fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
79 z = atof(argv[1]) + atof(argv[2]) * I;
82 printf("cacosh() = %6.3f %6.3f*i\en", creal(c), cimag(c));
84 f = 2 * clog(csqrt((z + 1)/2) + csqrt((z \- 1)/2));
85 printf("formula = %6.3f %6.3f*i\en", creal(f2), cimag(f2));