]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/catanh.3
a64l.3, addseverity.3, argz_add.3, cabs.3, cacos.3, cacosh.3, canonicalize_file_name...
[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 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
5 .\" %%%LICENSE_END
6 .\"
7 .TH CATANH 3 2011-09-15 "" "Linux Programmer's Manual"
8 .SH NAME
9 catanh, catanhf, catanhl \- complex arc tangents hyperbolic
10 .SH SYNOPSIS
11 .B #include <complex.h>
12 .sp
13 .BI "double complex catanh(double complex " z );
14 .br
15 .BI "float complex catanhf(float complex " z );
16 .br
17 .BI "long double complex catanhl(long double complex " z );
18 .sp
19 Link with \fI\-lm\fP.
20 .SH DESCRIPTION
21 The
22 .BR catanh ()
23 function calculates the complex arc hyperbolic tangent of
24 .IR z .
25 If \fIy\ =\ catanh(z)\fP, then \fIz\ =\ ctanh(y)\fP.
26 The imaginary part of
27 .I y
28 is chosen in the interval [\-pi/2,pi/2].
29 .LP
30 One has:
31 .nf
32
33 catanh(z) = 0.5 * (clog(1 + z) \- clog(1 \- z))
34 .fi
35 .SH VERSIONS
36 These functions first appeared in glibc in version 2.1.
37 .SH CONFORMING TO
38 C99.
39 .SH EXAMPLE
40 .nf
41 /* Link with "\-lm" */
42
43 #include <complex.h>
44 #include <stdlib.h>
45 #include <unistd.h>
46 #include <stdio.h>
47
48 int
49 main(int argc, char *argv[])
50 {
51 double complex z, c, f;
52
53 if (argc != 3) {
54 fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
55 exit(EXIT_FAILURE);
56 }
57
58 z = atof(argv[1]) + atof(argv[2]) * I;
59
60 c = catanh(z);
61 printf("catanh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
62
63 f = 0.5 * (clog(1 + z) \- clog(1 \- z));
64 printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));
65
66 exit(EXIT_SUCCESS);
67 }
68 .fi
69 .SH SEE ALSO
70 .BR atanh (3),
71 .BR cabs (3),
72 .BR cimag (3),
73 .BR ctanh (3),
74 .BR complex (7)