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