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
31       attributes(7).
32
33       ┌───────────────────────────────┬───────────────┬─────────┐
34Interface                      Attribute     Value   
35       ├───────────────────────────────┼───────────────┼─────────┤
36cacosh(), cacoshf(), cacoshl() │ Thread safety │ MT-Safe │
37       └───────────────────────────────┴───────────────┴─────────┘

CONFORMING TO

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

EXAMPLE

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

SEE ALSO

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

COLOPHON

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