Debian Codegraph @

upstream/debian-unstable/man3/catanh.3

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