]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/cacosh.3
fanotify_init.2, fanotify.7: Document FAN_REPORT_TID
[thirdparty/man-pages.git] / man3 / cacosh.3
1 .\" Copyright 2002 Walter Harms(walter.harms@informatik.uni-oldenburg.de)
2 .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
5 .\" Distributed under GPL
6 .\" %%%LICENSE_END
7 .\"
8 .TH CACOSH 3 2015-04-19 "" "Linux Programmer's Manual"
9 .SH NAME
10 cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine
11 .SH SYNOPSIS
12 .B #include <complex.h>
13 .PP
14 .BI "double complex cacosh(double complex " z );
15 .br
16 .BI "float complex cacoshf(float complex " z );
17 .br
18 .BI "long double complex cacoshl(long double complex " z );
19 .PP
20 Link with \fI\-lm\fP.
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 VERSIONS
38 These functions first appeared in glibc in version 2.1.
39 .SH ATTRIBUTES
40 For an explanation of the terms used in this section, see
41 .BR attributes (7).
42 .TS
43 allbox;
44 lbw30 lb lb
45 l l l.
46 Interface Attribute Value
47 T{
48 .BR cacosh (),
49 .BR cacoshf (),
50 .BR cacoshl ()
51 T} Thread safety MT-Safe
52 .TE
53 .SH CONFORMING TO
54 C99, POSIX.1-2001, POSIX.1-2008.
55 .SH EXAMPLE
56 .EX
57 /* Link with "\-lm" */
58
59 #include <complex.h>
60 #include <stdlib.h>
61 #include <unistd.h>
62 #include <stdio.h>
63
64 int
65 main(int argc, char *argv[])
66 {
67 double complex z, c, f;
68
69 if (argc != 3) {
70 fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
71 exit(EXIT_FAILURE);
72 }
73
74 z = atof(argv[1]) + atof(argv[2]) * I;
75
76 c = cacosh(z);
77 printf("cacosh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
78
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));
81
82 exit(EXIT_SUCCESS);
83 }
84 .EE
85 .SH SEE ALSO
86 .BR acosh (3),
87 .BR cabs (3),
88 .BR ccosh (3),
89 .BR cimag (3),
90 .BR complex (7)