]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/catanh.3
Many pages: Use correct letter case in page titles (TH)
[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 (date) "Linux man-pages (unreleased)"
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 .in +4n
31 .EX
32 catanh(z) = 0.5 * (clog(1 + z) \- clog(1 \- z))
33 .EE
34 .in
35 .SH VERSIONS
36 These functions first appeared in glibc in version 2.1.
37 .SH ATTRIBUTES
38 For an explanation of the terms used in this section, see
39 .BR attributes (7).
40 .ad l
41 .nh
42 .TS
43 allbox;
44 lbx lb lb
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
53 .hy
54 .ad
55 .sp 1
56 .SH STANDARDS
57 C99, POSIX.1-2001, POSIX.1-2008.
58 .SH EXAMPLES
59 .\" SRC BEGIN (catanh.c)
60 .EX
61 /* Link with "\-lm" */
62
63 #include <complex.h>
64 #include <stdio.h>
65 #include <stdlib.h>
66 #include <unistd.h>
67
68 int
69 main(int argc, char *argv[])
70 {
71 double complex z, c, f;
72
73 if (argc != 3) {
74 fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
75 exit(EXIT_FAILURE);
76 }
77
78 z = atof(argv[1]) + atof(argv[2]) * I;
79
80 c = catanh(z);
81 printf("catanh() = %6.3f %6.3f*i\en", creal(c), cimag(c));
82
83 f = 0.5 * (clog(1 + z) \- clog(1 \- z));
84 printf("formula = %6.3f %6.3f*i\en", creal(f), cimag(f));
85
86 exit(EXIT_SUCCESS);
87 }
88 .EE
89 .\" SRC END
90 .SH SEE ALSO
91 .BR atanh (3),
92 .BR cabs (3),
93 .BR cimag (3),
94 .BR ctanh (3),
95 .BR complex (7)