]>
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 | .\" |
45186a5d | 6 | .TH CATANH 3 2021-03-22 "Linux man-pages (unreleased)" |
fea681da MK |
7 | .SH NAME |
8 | catanh, catanhf, catanhl \- complex arc tangents hyperbolic | |
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 catanh(double complex " z ); |
fea681da | 17 | .BI "float complex catanhf(float complex " z ); |
fea681da | 18 | .BI "long double complex catanhl(long double complex " z ); |
c7db92b9 | 19 | .fi |
fea681da | 20 | .SH DESCRIPTION |
5600f73a | 21 | These functions calculate the complex arc hyperbolic tangent of |
daac0b39 | 22 | .IR z . |
1ae6b2c7 | 23 | If \fIy\~=\~catanh(z)\fP, then \fIz\~=\~ctanh(y)\fP. |
daac0b39 MK |
24 | The imaginary part of |
25 | .I y | |
26 | is chosen in the interval [\-pi/2,pi/2]. | |
dd3568a1 | 27 | .PP |
daac0b39 | 28 | One has: |
207050fa | 29 | .PP |
1ae6b2c7 AC |
30 | .in +4n |
31 | .EX | |
32 | catanh(z) = 0.5 * (clog(1 + z) \- clog(1 \- z)) | |
33 | .EE | |
34 | .in | |
f0d7ce1d MK |
35 | .SH VERSIONS |
36 | These functions first appeared in glibc in version 2.1. | |
0b3cafe3 MS |
37 | .SH ATTRIBUTES |
38 | For an explanation of the terms used in this section, see | |
39 | .BR attributes (7). | |
c466875e MK |
40 | .ad l |
41 | .nh | |
0b3cafe3 MS |
42 | .TS |
43 | allbox; | |
c466875e | 44 | lbx lb lb |
0b3cafe3 MS |
45 | l l l. |
46 | Interface Attribute Value | |
47 | T{ | |
48 | .BR catanh (), | |
49 | .BR catanhf (), | |
50 | .BR catanhl () | |
51 | T} Thread safety MT-Safe | |
52 | .TE | |
c466875e MK |
53 | .hy |
54 | .ad | |
55 | .sp 1 | |
3113c7f3 | 56 | .SH STANDARDS |
9a74e018 | 57 | C99, POSIX.1-2001, POSIX.1-2008. |
a14af333 | 58 | .SH EXAMPLES |
207050fa | 59 | .EX |
849ef4a8 MK |
60 | /* Link with "\-lm" */ |
61 | ||
62 | #include <complex.h> | |
63 | #include <stdlib.h> | |
64 | #include <unistd.h> | |
65 | #include <stdio.h> | |
66 | ||
67 | int | |
68 | main(int argc, char *argv[]) | |
69 | { | |
70 | double complex z, c, f; | |
71 | ||
72 | if (argc != 3) { | |
d1a71985 | 73 | fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]); |
849ef4a8 MK |
74 | exit(EXIT_FAILURE); |
75 | } | |
76 | ||
77 | z = atof(argv[1]) + atof(argv[2]) * I; | |
78 | ||
79 | c = catanh(z); | |
d1a71985 | 80 | printf("catanh() = %6.3f %6.3f*i\en", creal(c), cimag(c)); |
849ef4a8 MK |
81 | |
82 | f = 0.5 * (clog(1 + z) \- clog(1 \- z)); | |
716f16ae | 83 | printf("formula = %6.3f %6.3f*i\en", creal(f), cimag(f)); |
849ef4a8 MK |
84 | |
85 | exit(EXIT_SUCCESS); | |
86 | } | |
207050fa | 87 | .EE |
47297adb | 88 | .SH SEE ALSO |
fea681da MK |
89 | .BR atanh (3), |
90 | .BR cabs (3), | |
91 | .BR cimag (3), | |
5be56312 | 92 | .BR ctanh (3), |
a8bda636 | 93 | .BR complex (7) |