summaryrefslogtreecommitdiff
path: root/lib/libm/ctanh.c
blob: a99e14967ba421d556e1e78c54fee9c7d97f135d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <math.h>
#include <complex.h>

double complex ctanh(double complex z)
{
	double x, y, d;

	x = creal(z);
	y = cimag(z);
	d = cosh(2.0 * x) + cos(2.0 * y);

	return sinh(2.0 * x) / d + (sin(2.0 * y) / d) * (double complex)I;
}