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