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 2015-04-19 "" "Linux Programmer's Manual"
10 cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine
12 .B #include <complex.h>
14 .BI "double complex cacosh(double complex " z );
16 .BI "float complex cacoshf(float complex " z );
18 .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
46 Interface Attribute Value
51 T} Thread safety MT-Safe
54 C99, POSIX.1-2001, POSIX.1-2008.
57 /* Link with "\-lm" */
65 main(int argc, char *argv[])
67 double complex z, c, f;
70 fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
74 z = atof(argv[1]) + atof(argv[2]) * I;
77 printf("cacosh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
79 f = 2 * clog(csqrt((z + 1)/2) + csqrt((z \- 1)/2));
80 printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));