summaryrefslogtreecommitdiff
path: root/lib/libm/ctanhl.c
blob: 1c9b9b814cf611e98cd4d0b67fbb418cf468a697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <complex.h> // for complex, cimagl, creall, ctanhl, I
#include <math.h>    // for coshl, cosl, sinhl, sinl

long double complex ctanhl(long double complex z)
{
	long double x, y, d;

	x = creall(z);
	y = cimagl(z);
	d = coshl(2.0L * x) + cosl(2.0L * y);

	return sinhl(2.0L * x) / d +
	       (sinl(2.0L * y) / d) * (long double complex)I;
}