localedef.1, access.2, ioctl_console.2, ioctl_fslabel.2, openat2.2, write.2, dlsym...
[man-pages.git] / man3 / catanh.3
blobdc70867a4d530a9525d8202fe286374a4dde6b9f
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
5 .\" Distributed under GPL
6 .\" %%%LICENSE_END
7 .\"
8 .TH CATANH 3 2021-03-22 "" "Linux Programmer's Manual"
9 .SH NAME
10 catanh, catanhf, catanhl \- complex arc tangents hyperbolic
11 .SH SYNOPSIS
12 .nf
13 .B #include <complex.h>
14 .PP
15 .BI "double complex catanh(double complex " z );
16 .BI "float complex catanhf(float complex " z );
17 .BI "long double complex catanhl(long double complex " z );
18 .PP
19 Link with \fI\-lm\fP.
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 .PP
29 One has:
30 .PP
31 .nf
32     catanh(z) = 0.5 * (clog(1 + z) \- clog(1 \- z))
33 .fi
34 .SH VERSIONS
35 These functions first appeared in glibc in version 2.1.
36 .SH ATTRIBUTES
37 For an explanation of the terms used in this section, see
38 .BR attributes (7).
39 .ad l
40 .nh
41 .TS
42 allbox;
43 lbx lb lb
44 l l l.
45 Interface       Attribute       Value
47 .BR catanh (),
48 .BR catanhf (),
49 .BR catanhl ()
50 T}      Thread safety   MT-Safe
51 .TE
52 .hy
53 .ad
54 .sp 1
55 .SH CONFORMING TO
56 C99, POSIX.1-2001, POSIX.1-2008.
57 .SH EXAMPLES
58 .EX
59 /* Link with "\-lm" */
61 #include <complex.h>
62 #include <stdlib.h>
63 #include <unistd.h>
64 #include <stdio.h>
66 int
67 main(int argc, char *argv[])
69     double complex z, c, f;
71     if (argc != 3) {
72         fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
73         exit(EXIT_FAILURE);
74     }
76     z = atof(argv[1]) + atof(argv[2]) * I;
78     c = catanh(z);
79     printf("catanh() = %6.3f %6.3f*i\en", creal(c), cimag(c));
81     f = 0.5 * (clog(1 + z) \- clog(1 \- z));
82     printf("formula  = %6.3f %6.3f*i\en", creal(f2), cimag(f2));
84     exit(EXIT_SUCCESS);
86 .EE
87 .SH SEE ALSO
88 .BR atanh (3),
89 .BR cabs (3),
90 .BR cimag (3),
91 .BR ctanh (3),
92 .BR complex (7)