]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2002 Walter Harms(walter.harms@informatik.uni-oldenburg.de) |
cd2c21a0 | 2 | .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com> |
2297bf0e | 3 | .\" |
95fb8859 | 4 | .\" SPDX-License-Identifier: GPL-1.0-or-later |
fea681da | 5 | .\" |
1ae6b2c7 | 6 | .TH CACOSH 3 2021-03-22 GNU "Linux Programmer's Manual" |
fea681da MK |
7 | .SH NAME |
8 | cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine | |
2af19291 AC |
9 | .SH LIBRARY |
10 | Math library | |
8fc3b2cf | 11 | .RI ( libm ", " \-lm ) |
fea681da | 12 | .SH SYNOPSIS |
c7db92b9 | 13 | .nf |
fea681da | 14 | .B #include <complex.h> |
68e4db0a | 15 | .PP |
c13182ef | 16 | .BI "double complex cacosh(double complex " z ); |
fea681da | 17 | .BI "float complex cacoshf(float complex " z ); |
fea681da | 18 | .BI "long double complex cacoshl(long double complex " z ); |
c7db92b9 | 19 | .fi |
fea681da | 20 | .SH DESCRIPTION |
5600f73a | 21 | These functions calculate the complex arc hyperbolic cosine of |
80f1c436 MK |
22 | .IR z . |
23 | If \fIy\ =\ cacosh(z)\fP, then \fIz\ =\ ccosh(y)\fP. | |
24 | The imaginary part of | |
25 | .I y | |
26 | is chosen in the interval [\-pi,pi]. | |
27 | The real part of | |
28 | .I y | |
2fda57bd | 29 | is chosen nonnegative. |
dd3568a1 | 30 | .PP |
f262c004 | 31 | One has: |
207050fa | 32 | .PP |
80f1c436 | 33 | .nf |
4c3fa19d | 34 | cacosh(z) = 2 * clog(csqrt((z + 1) / 2) + csqrt((z \- 1) / 2)) |
80f1c436 | 35 | .fi |
f0d7ce1d MK |
36 | .SH VERSIONS |
37 | These functions first appeared in glibc in version 2.1. | |
318c528f MS |
38 | .SH ATTRIBUTES |
39 | For an explanation of the terms used in this section, see | |
40 | .BR attributes (7). | |
c466875e MK |
41 | .ad l |
42 | .nh | |
318c528f MS |
43 | .TS |
44 | allbox; | |
c466875e | 45 | lbx lb lb |
318c528f MS |
46 | l l l. |
47 | Interface Attribute Value | |
48 | T{ | |
49 | .BR cacosh (), | |
50 | .BR cacoshf (), | |
51 | .BR cacoshl () | |
52 | T} Thread safety MT-Safe | |
53 | .TE | |
c466875e MK |
54 | .hy |
55 | .ad | |
56 | .sp 1 | |
47297adb | 57 | .SH CONFORMING TO |
9a74e018 | 58 | C99, POSIX.1-2001, POSIX.1-2008. |
a14af333 | 59 | .SH EXAMPLES |
207050fa | 60 | .EX |
8b57a223 MK |
61 | /* Link with "\-lm" */ |
62 | ||
63 | #include <complex.h> | |
64 | #include <stdlib.h> | |
65 | #include <unistd.h> | |
66 | #include <stdio.h> | |
67 | ||
68 | int | |
69 | main(int argc, char *argv[]) | |
70 | { | |
71 | double complex z, c, f; | |
72 | ||
73 | if (argc != 3) { | |
d1a71985 | 74 | fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]); |
8b57a223 MK |
75 | exit(EXIT_FAILURE); |
76 | } | |
77 | ||
78 | z = atof(argv[1]) + atof(argv[2]) * I; | |
79 | ||
80 | c = cacosh(z); | |
d1a71985 | 81 | printf("cacosh() = %6.3f %6.3f*i\en", creal(c), cimag(c)); |
8b57a223 MK |
82 | |
83 | f = 2 * clog(csqrt((z + 1)/2) + csqrt((z \- 1)/2)); | |
d1a71985 | 84 | printf("formula = %6.3f %6.3f*i\en", creal(f2), cimag(f2)); |
8b57a223 MK |
85 | |
86 | exit(EXIT_SUCCESS); | |
87 | } | |
207050fa | 88 | .EE |
47297adb | 89 | .SH SEE ALSO |
fea681da MK |
90 | .BR acosh (3), |
91 | .BR cabs (3), | |
5be56312 | 92 | .BR ccosh (3), |
fea681da | 93 | .BR cimag (3), |
a8bda636 | 94 | .BR complex (7) |