]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/catanh.3
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[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 .\" Distributed under GPL
4 .\"
5 .TH CATANH 3 2011-09-15 "" "Linux Programmer's Manual"
6 .SH NAME
7 catanh, catanhf, catanhl \- complex arc tangents hyperbolic
8 .SH SYNOPSIS
9 .B #include <complex.h>
10 .sp
11 .BI "double complex catanh(double complex " z );
12 .br
13 .BI "float complex catanhf(float complex " z );
14 .br
15 .BI "long double complex catanhl(long double complex " z );
16 .sp
17 Link with \fI\-lm\fP.
18 .SH DESCRIPTION
19 The
20 .BR catanh ()
21 function calculates 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 .LP
28 One has:
29 .nf
30
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 CONFORMING TO
36 C99.
37 .SH EXAMPLE
38 .nf
39 /* Link with "\-lm" */
40
41 #include <complex.h>
42 #include <stdlib.h>
43 #include <unistd.h>
44 #include <stdio.h>
45
46 int
47 main(int argc, char *argv[])
48 {
49 double complex z, c, f;
50
51 if (argc != 3) {
52 fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
53 exit(EXIT_FAILURE);
54 }
55
56 z = atof(argv[1]) + atof(argv[2]) * I;
57
58 c = catanh(z);
59 printf("catanh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
60
61 f = 0.5 * (clog(1 + z) \- clog(1 \- z));
62 printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));
63
64 exit(EXIT_SUCCESS);
65 }
66 .fi
67 .SH SEE ALSO
68 .BR atanh (3),
69 .BR cabs (3),
70 .BR cimag (3),
71 .BR ctanh (3),
72 .BR complex (7)