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