]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/cacosh.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / man3 / cacosh.3
1 '\" t
2 .\" Copyright 2002 Walter Harms(walter.harms@informatik.uni-oldenburg.de)
3 .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\"
5 .\" SPDX-License-Identifier: GPL-1.0-or-later
6 .\"
7 .TH cacosh 3 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine
10 .SH LIBRARY
11 Math library
12 .RI ( libm ", " \-lm )
13 .SH SYNOPSIS
14 .nf
15 .B #include <complex.h>
16 .PP
17 .BI "double complex cacosh(double complex " z );
18 .BI "float complex cacoshf(float complex " z );
19 .BI "long double complex cacoshl(long double complex " z );
20 .fi
21 .SH DESCRIPTION
22 These functions calculate the complex arc hyperbolic cosine of
23 .IR z .
24 If \fIy\ =\ cacosh(z)\fP, then \fIz\ =\ ccosh(y)\fP.
25 The imaginary part of
26 .I y
27 is chosen in the interval [\-pi,pi].
28 The real part of
29 .I y
30 is chosen nonnegative.
31 .PP
32 One has:
33 .PP
34 .nf
35 cacosh(z) = 2 * clog(csqrt((z + 1) / 2) + csqrt((z \- 1) / 2))
36 .fi
37 .SH ATTRIBUTES
38 For an explanation of the terms used in this section, see
39 .BR attributes (7).
40 .TS
41 allbox;
42 lbx lb lb
43 l l l.
44 Interface Attribute Value
45 T{
46 .na
47 .nh
48 .BR cacosh (),
49 .BR cacoshf (),
50 .BR cacoshl ()
51 T} Thread safety MT-Safe
52 .TE
53 .sp 1
54 .SH STANDARDS
55 C11, POSIX.1-2008.
56 .SH HISTORY
57 C99, POSIX.1-2001.
58 glibc 2.1.
59 .SH EXAMPLES
60 .\" SRC BEGIN (cacosh.c)
61 .EX
62 /* Link with "\-lm" */
63 \&
64 #include <complex.h>
65 #include <stdio.h>
66 #include <stdlib.h>
67 #include <unistd.h>
68 \&
69 int
70 main(int argc, char *argv[])
71 {
72 double complex z, c, f;
73 \&
74 if (argc != 3) {
75 fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
76 exit(EXIT_FAILURE);
77 }
78 \&
79 z = atof(argv[1]) + atof(argv[2]) * I;
80 \&
81 c = cacosh(z);
82 printf("cacosh() = %6.3f %6.3f*i\en", creal(c), cimag(c));
83 \&
84 f = 2 * clog(csqrt((z + 1)/2) + csqrt((z \- 1)/2));
85 printf("formula = %6.3f %6.3f*i\en", creal(f), cimag(f));
86 \&
87 exit(EXIT_SUCCESS);
88 }
89 .EE
90 .\" SRC END
91 .SH SEE ALSO
92 .BR acosh (3),
93 .BR cabs (3),
94 .BR ccosh (3),
95 .BR cimag (3),
96 .BR complex (7)