1CACOSH(3)                  Linux Programmer's Manual                 CACOSH(3)
2
3
4

NAME

6       cacosh, cacoshf, cacoshl - complex arc hyperbolic cosine
7

SYNOPSIS

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

DESCRIPTION

18       These  functions  calculate the complex arc hyperbolic cosine of z.  If
19       y = cacosh(z), then z = ccosh(y).  The imaginary part of y is chosen in
20       the interval [-pi,pi].  The real part of y is chosen nonnegative.
21
22       One has:
23
24           cacosh(z) = 2 * clog(csqrt((z + 1) / 2) + csqrt((z - 1) / 2))
25

VERSIONS

27       These functions first appeared in glibc in version 2.1.
28

ATTRIBUTES

30       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
31       tributes(7).
32
33       ┌────────────────────────────────────────────┬───────────────┬─────────┐
34Interface                                   Attribute     Value   
35       ├────────────────────────────────────────────┼───────────────┼─────────┤
36cacosh(), cacoshf(), cacoshl()              │ Thread safety │ MT-Safe │
37       └────────────────────────────────────────────┴───────────────┴─────────┘
38

CONFORMING TO

40       C99, POSIX.1-2001, POSIX.1-2008.
41

EXAMPLES

43       /* Link with "-lm" */
44
45       #include <complex.h>
46       #include <stdlib.h>
47       #include <unistd.h>
48       #include <stdio.h>
49
50       int
51       main(int argc, char *argv[])
52       {
53           double complex z, c, f;
54
55           if (argc != 3) {
56               fprintf(stderr, "Usage: %s <real> <imag>\n", argv[0]);
57               exit(EXIT_FAILURE);
58           }
59
60           z = atof(argv[1]) + atof(argv[2]) * I;
61
62           c = cacosh(z);
63           printf("cacosh() = %6.3f %6.3f*i\n", creal(c), cimag(c));
64
65           f = 2 * clog(csqrt((z + 1)/2) + csqrt((z - 1)/2));
66           printf("formula  = %6.3f %6.3f*i\n", creal(f2), cimag(f2));
67
68           exit(EXIT_SUCCESS);
69       }
70

SEE ALSO

72       acosh(3), cabs(3), ccosh(3), cimag(3), complex(7)
73

COLOPHON

75       This page is part of release 5.12 of the Linux  man-pages  project.   A
76       description  of  the project, information about reporting bugs, and the
77       latest    version    of    this    page,    can     be     found     at
78       https://www.kernel.org/doc/man-pages/.
79
80
81
82                                  2021-03-22                         CACOSH(3)
Impressum