]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/catanh.3
fuse.4: fuse_entry_out: rework discussion of uniqueness of nodeid + generation
[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 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
5 .\" Distributed under GPL
6 .\" %%%LICENSE_END
7 .\"
8 .TH CATANH 3 2015-04-19 "" "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 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 .LP
29 One has:
30 .nf
31
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 .TS
40 allbox;
41 lbw30 lb lb
42 l l l.
43 Interface Attribute Value
44 T{
45 .BR catanh (),
46 .BR catanhf (),
47 .BR catanhl ()
48 T} Thread safety MT-Safe
49 .TE
50 .SH CONFORMING TO
51 C99, POSIX.1-2001, POSIX.1-2008.
52 .SH EXAMPLE
53 .nf
54 /* Link with "\-lm" */
55
56 #include <complex.h>
57 #include <stdlib.h>
58 #include <unistd.h>
59 #include <stdio.h>
60
61 int
62 main(int argc, char *argv[])
63 {
64 double complex z, c, f;
65
66 if (argc != 3) {
67 fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
68 exit(EXIT_FAILURE);
69 }
70
71 z = atof(argv[1]) + atof(argv[2]) * I;
72
73 c = catanh(z);
74 printf("catanh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
75
76 f = 0.5 * (clog(1 + z) \- clog(1 \- z));
77 printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));
78
79 exit(EXIT_SUCCESS);
80 }
81 .fi
82 .SH SEE ALSO
83 .BR atanh (3),
84 .BR cabs (3),
85 .BR cimag (3),
86 .BR ctanh (3),
87 .BR complex (7)