1CACOSH(3) Linux Programmer's Manual CACOSH(3)
2
3
4
6 cacosh, cacoshf, cacoshl - complex arc hyperbolic cosine
7
9 #include <complex.h>
10
11 double complex cacosh(double complex z);
12 float complex cacoshf(float complex z);
13 long double complex cacoshl(long double complex z);
14
15 Link with -lm.
16
18 The cacosh() function calculates the complex arc hyperpolic cosine of
19 z. If y = cacosh(z), then z = ccosh(y). The imaginary part of y is
20 chosen in the interval [-pi,pi]. The real part of y is chosen nonnega‐
21 tive.
22
23 One has:
24
25 cacosh(z) = 2 * clog(csqrt((z + 1) / 2) + csqrt((z - 1) / 2))
26
28 These functions first appeared in glibc in version 2.1.
29
31 C99.
32
34 /* Link with "-lm" */
35
36 #include <complex.h>
37 #include <stdlib.h>
38 #include <unistd.h>
39 #include <stdio.h>
40
41 int
42 main(int argc, char *argv[])
43 {
44 double complex z, c, f;
45
46 if (argc != 3) {
47 fprintf(stderr, "Usage: %s <real> <imag>\n", argv[0]);
48 exit(EXIT_FAILURE);
49 }
50
51 z = atof(argv[1]) + atof(argv[2]) * I;
52
53 c = cacosh(z);
54 printf("cacosh() = %6.3f %6.3f*i\n", creal(c), cimag(c));
55
56 f = 2 * clog(csqrt((z + 1)/2) + csqrt((z - 1)/2));
57 printf("formula = %6.3f %6.3f*i\n", creal(f2), cimag(f2));
58
59 exit(EXIT_SUCCESS);
60 }
61
63 acosh(3), cabs(3), ccosh(3), cimag(3), complex(7)
64
66 This page is part of release 3.53 of the Linux man-pages project. A
67 description of the project, and information about reporting bugs, can
68 be found at http://www.kernel.org/doc/man-pages/.
69
70
71
72 2011-09-15 CACOSH(3)