OSDN Git Service

(split) LDP: Change Makefile to stamp-based compilation
[linuxjm/LDP_man-pages.git] / original / 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 2011-09-15 "" "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 CONFORMING TO
39 C99.
40 .SH EXAMPLE
41 .nf
42 /* Link with "\-lm" */
43
44 #include <complex.h>
45 #include <stdlib.h>
46 #include <unistd.h>
47 #include <stdio.h>
48
49 int
50 main(int argc, char *argv[])
51 {
52     double complex z, c, f;
53
54     if (argc != 3) {
55         fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
56         exit(EXIT_FAILURE);
57     }
58
59     z = atof(argv[1]) + atof(argv[2]) * I;
60
61     c = catanh(z);
62     printf("catanh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
63
64     f = 0.5 * (clog(1 + z) \- clog(1 \- z));
65     printf("formula  = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));
66
67     exit(EXIT_SUCCESS);
68 }
69 .fi
70 .SH SEE ALSO
71 .BR atanh (3),
72 .BR cabs (3),
73 .BR cimag (3),
74 .BR ctanh (3),
75 .BR complex (7)