—
NAME
catanh, catanhf, catanhl - complex arc tangents hyperbolic
LIBRARY
Math library (libm, -lm)
SYNOPSIS
bash
#include <complex.h>bash
double complex catanh(double complex \nz\n);\n
\nfloat complex catanhf(float complex \nz\n);\n
\nlong double complex catanhl(long double complex \nz\n);DESCRIPTION
These functions calculate the complex arc hyperbolic tangent of z. If y = catanh(z), then z = ctanh(y). The imaginary part of y is chosen in the interval [-pi/2,pi/2].
One has:
bash
catanh(z) = 0.5 * (clog(1 + z) - clog(1 - z))ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
| Interface | Attribute | Value |
| catanh (), catanhf (), catanhl () | Thread safety | MT-Safe |
STANDARDS
C11, POSIX.1-2008.
HISTORY
glibc 2.1. C99, POSIX.1-2001.
EXAMPLES
bash
/* Link with "-lm" */
#include <complex.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int
main(int argc, char *argv[])
{
\n
double complex z, c, f;
\n
if (argc != 3) {
\n
fprintf(stderr, "Usage: %s <real> <imag>\n", argv[0]);
\n
exit(EXIT_FAILURE);
\n
}
\n
z = atof(argv[1]) + atof(argv[2]) * I;
\n
c = catanh(z);
\n
printf("catanh() = %6.3f %6.3f*i\n", creal(c), cimag(c));
\n
f = 0.5 * (clog(1 + z) - clog(1 - z));
\n
printf("formula = %6.3f %6.3f*i\n", creal(f), cimag(f));
\n
exit(EXIT_SUCCESS);
}SEE ALSO
atanh(3), cabs(3), cimag(3), ctanh(3), complex(7)