]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/catanh.3
acos.3, acosh.3, asin.3, asinh.3, atan.3, atan2.3, atanh.3, cabs.3, cacos.3, cacosh...
[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@gamil.com>
3 .\"
4 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
5 .\" Distributed under GPL
6 .\" %%%LICENSE_END
7 .\"
8 .TH CATANH 3 2015-03-02 "" "Linux Programmer's Manual"
9 .SH NAME
10 catanh, catanhf, catanhl \- complex arc tangents hyperbolic
11 .SH SYNOPSIS
12 .B #include <complex.h>
13 .sp
14 .BI "double complex catanh(double complex " z );
15 .br
16 .BI "float complex catanhf(float complex " z );
17 .br
18 .BI "long double complex catanhl(long double complex " z );
19 .sp
20 Link with \fI\-lm\fP.
21 .SH DESCRIPTION
22 The
23 .BR catanh ()
24 function calculates the complex arc hyperbolic tangent of
25 .IR z .
26 If \fIy\ =\ catanh(z)\fP, then \fIz\ =\ ctanh(y)\fP.
27 The imaginary part of
28 .I y
29 is chosen in the interval [\-pi/2,pi/2].
30 .LP
31 One has:
32 .nf
33
34 catanh(z) = 0.5 * (clog(1 + z) \- clog(1 \- z))
35 .fi
36 .SH VERSIONS
37 These functions first appeared in glibc in version 2.1.
38 .SH ATTRIBUTES
39 For an explanation of the terms used in this section, see
40 .BR attributes (7).
41 .TS
42 allbox;
43 lbw30 lb lb
44 l l l.
45 Interface Attribute Value
46 T{
47 .BR catanh (),
48 .BR catanhf (),
49 .BR catanhl ()
50 T} Thread safety MT-Safe
51 .TE
52 .SH CONFORMING TO
53 C99, POSIX.1-2001, POSIX.1-2008.
54 .SH EXAMPLE
55 .nf
56 /* Link with "\-lm" */
57
58 #include <complex.h>
59 #include <stdlib.h>
60 #include <unistd.h>
61 #include <stdio.h>
62
63 int
64 main(int argc, char *argv[])
65 {
66 double complex z, c, f;
67
68 if (argc != 3) {
69 fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
70 exit(EXIT_FAILURE);
71 }
72
73 z = atof(argv[1]) + atof(argv[2]) * I;
74
75 c = catanh(z);
76 printf("catanh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
77
78 f = 0.5 * (clog(1 + z) \- clog(1 \- z));
79 printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));
80
81 exit(EXIT_SUCCESS);
82 }
83 .fi
84 .SH SEE ALSO
85 .BR atanh (3),
86 .BR cabs (3),
87 .BR cimag (3),
88 .BR ctanh (3),
89 .BR complex (7)