]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/catanh.3
dlopen.3: tfix
[thirdparty/man-pages.git] / man3 / catanh.3
CommitLineData
fea681da 1.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
cd2c21a0 2.\" and Copyright (C) 2011 Michael Kerrisk <mtk.manpages@gmail.com>
2297bf0e 3.\"
38f20bb9 4.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
fea681da 5.\" Distributed under GPL
38f20bb9 6.\" %%%LICENSE_END
fea681da 7.\"
9ba01802 8.TH CATANH 3 2019-03-06 "" "Linux Programmer's Manual"
fea681da
MK
9.SH NAME
10catanh, catanhf, catanhl \- complex arc tangents hyperbolic
11.SH SYNOPSIS
12.B #include <complex.h>
68e4db0a 13.PP
c13182ef 14.BI "double complex catanh(double complex " z );
d39541ec 15.br
fea681da 16.BI "float complex catanhf(float complex " z );
d39541ec 17.br
fea681da 18.BI "long double complex catanhl(long double complex " z );
68e4db0a 19.PP
20c58d70 20Link with \fI\-lm\fP.
fea681da 21.SH DESCRIPTION
5600f73a 22These functions calculate the complex arc hyperbolic tangent of
daac0b39
MK
23.IR z .
24If \fIy\ =\ catanh(z)\fP, then \fIz\ =\ ctanh(y)\fP.
25The imaginary part of
26.I y
27is chosen in the interval [\-pi/2,pi/2].
dd3568a1 28.PP
daac0b39 29One has:
207050fa 30.PP
daac0b39 31.nf
4c3fa19d 32 catanh(z) = 0.5 * (clog(1 + z) \- clog(1 \- z))
daac0b39 33.fi
f0d7ce1d
MK
34.SH VERSIONS
35These functions first appeared in glibc in version 2.1.
0b3cafe3
MS
36.SH ATTRIBUTES
37For an explanation of the terms used in this section, see
38.BR attributes (7).
39.TS
40allbox;
41lbw30 lb lb
42l l l.
43Interface Attribute Value
44T{
45.BR catanh (),
46.BR catanhf (),
47.BR catanhl ()
48T} Thread safety MT-Safe
49.TE
47297adb 50.SH CONFORMING TO
9a74e018 51C99, POSIX.1-2001, POSIX.1-2008.
849ef4a8 52.SH EXAMPLE
207050fa 53.EX
849ef4a8
MK
54/* Link with "\-lm" */
55
56#include <complex.h>
57#include <stdlib.h>
58#include <unistd.h>
59#include <stdio.h>
60
61int
62main(int argc, char *argv[])
63{
64 double complex z, c, f;
65
66 if (argc != 3) {
d1a71985 67 fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
849ef4a8
MK
68 exit(EXIT_FAILURE);
69 }
70
71 z = atof(argv[1]) + atof(argv[2]) * I;
72
73 c = catanh(z);
d1a71985 74 printf("catanh() = %6.3f %6.3f*i\en", creal(c), cimag(c));
849ef4a8
MK
75
76 f = 0.5 * (clog(1 + z) \- clog(1 \- z));
d1a71985 77 printf("formula = %6.3f %6.3f*i\en", creal(f2), cimag(f2));
849ef4a8
MK
78
79 exit(EXIT_SUCCESS);
80}
207050fa 81.EE
47297adb 82.SH SEE ALSO
fea681da
MK
83.BR atanh (3),
84.BR cabs (3),
85.BR cimag (3),
5be56312 86.BR ctanh (3),
a8bda636 87.BR complex (7)