]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/cacosh.3
_exit.2, bpf.2, cacheflush.2, capget.2, chdir.2, chmod.2, chroot.2, clock_getres...
[thirdparty/man-pages.git] / man3 / cacosh.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.\"
c73595c2 8.TH CACOSH 3 2015-04-19 "" "Linux Programmer's Manual"
fea681da
MK
9.SH NAME
10cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine
11.SH SYNOPSIS
12.B #include <complex.h>
68e4db0a 13.PP
c13182ef 14.BI "double complex cacosh(double complex " z );
d39541ec 15.br
fea681da 16.BI "float complex cacoshf(float complex " z );
d39541ec 17.br
fea681da 18.BI "long double complex cacoshl(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 cosine of
80f1c436
MK
23.IR z .
24If \fIy\ =\ cacosh(z)\fP, then \fIz\ =\ ccosh(y)\fP.
25The imaginary part of
26.I y
27is chosen in the interval [\-pi,pi].
28The real part of
29.I y
2fda57bd 30is chosen nonnegative.
fea681da 31.LP
f262c004 32One has:
80f1c436
MK
33.nf
34
4c3fa19d 35 cacosh(z) = 2 * clog(csqrt((z + 1) / 2) + csqrt((z \- 1) / 2))
80f1c436 36.fi
f0d7ce1d
MK
37.SH VERSIONS
38These functions first appeared in glibc in version 2.1.
318c528f
MS
39.SH ATTRIBUTES
40For an explanation of the terms used in this section, see
41.BR attributes (7).
42.TS
43allbox;
44lbw30 lb lb
45l l l.
46Interface Attribute Value
47T{
48.BR cacosh (),
49.BR cacoshf (),
50.BR cacoshl ()
51T} Thread safety MT-Safe
52.TE
47297adb 53.SH CONFORMING TO
9a74e018 54C99, POSIX.1-2001, POSIX.1-2008.
8b57a223
MK
55.SH EXAMPLE
56.nf
57/* Link with "\-lm" */
58
59#include <complex.h>
60#include <stdlib.h>
61#include <unistd.h>
62#include <stdio.h>
63
64int
65main(int argc, char *argv[])
66{
67 double complex z, c, f;
68
69 if (argc != 3) {
70 fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
71 exit(EXIT_FAILURE);
72 }
73
74 z = atof(argv[1]) + atof(argv[2]) * I;
75
76 c = cacosh(z);
77 printf("cacosh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
78
79 f = 2 * clog(csqrt((z + 1)/2) + csqrt((z \- 1)/2));
80 printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));
81
82 exit(EXIT_SUCCESS);
83}
84.fi
47297adb 85.SH SEE ALSO
fea681da
MK
86.BR acosh (3),
87.BR cabs (3),
5be56312 88.BR ccosh (3),
fea681da 89.BR cimag (3),
a8bda636 90.BR complex (7)