blob: 1402d52e85fcfbfff37b8e95587ada35bd1643ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include "__complex.h" // for ctansl
#include <complex.h> // for cimagl, complex, creall, I, ctanl
#include <math.h> // for HUGE_VALL, coshl, cosl, fabsl, sinhl, sinl
long double complex ctanl(long double complex z)
{
long double d = cosl(2.0L * creall(z)) + coshl(2.0L * cimagl(z));
if (fabsl(d) < 0.25L) {
d = ctansl(z);
}
if (d == 0.0L) {
return HUGE_VALL + HUGE_VALL * (long double complex)I;
}
return sinl(2.0L * creall(z)) / d + (sinhl(2.0L * cimagl(z)) / d) * (long double complex)I;
}
|