Debian Codegraph @

upstream/debian-trixie/man3/catanh.3

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