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
5 .TH CACOSH 3 2011-09-15 "" "Linux Programmer's Manual"
7 cacosh, cacoshf, cacoshl \- complex arc hyperbolic cosine
9 .B #include <complex.h>
11 .BI "double complex cacosh(double complex " z );
13 .BI "float complex cacoshf(float complex " z );
15 .BI "long double complex cacoshl(long double complex " z );
21 function calculates the complex arc hyperpolic cosine of
23 If \fIy\ =\ cacosh(z)\fP, then \fIz\ =\ ccosh(y)\fP.
26 is chosen in the interval [\-pi,pi].
29 is chosen nonnegative.
34 cacosh(z) = 2 * clog(csqrt((z + 1) / 2) + csqrt((z \- 1) / 2))
37 These functions first appeared in glibc in version 2.1.
42 /* Link with "\-lm" */
50 main(int argc, char *argv[])
52 double complex z, c, f;
55 fprintf(stderr, "Usage: %s <real> <imag>\\n", argv[0]);
59 z = atof(argv[1]) + atof(argv[2]) * I;
62 printf("cacosh() = %6.3f %6.3f*i\\n", creal(c), cimag(c));
64 f = 2 * clog(csqrt((z + 1)/2) + csqrt((z \- 1)/2));
65 printf("formula = %6.3f %6.3f*i\\n", creal(f2), cimag(f2));