1 2 3 4 5 6 7 8 9 10 11 12 13
#include <math.h> #include <complex.h> float complex ctanhf(float complex z) { float x, y, d; x = crealf(z); y = cimagf(z); d = coshf(2.0f * x) + cosf(2.0f * y); return sinhf(2.0f * x) / d + (sinf(2.0f * y) / d) * I; }