diff options
Diffstat (limited to 'lib/libm/ctanh.c')
| -rw-r--r-- | lib/libm/ctanh.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/libm/ctanh.c b/lib/libm/ctanh.c new file mode 100644 index 00000000..a99e1496 --- /dev/null +++ b/lib/libm/ctanh.c @@ -0,0 +1,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; +} |
