first commit of the new libm!
[musl] / src / complex / ctan.c
diff --git a/src/complex/ctan.c b/src/complex/ctan.c
new file mode 100644 (file)
index 0000000..4741a4d
--- /dev/null
@@ -0,0 +1,9 @@
+#include "libm.h"
+
+/* tan(z) = -i tanh(i z) */
+
+double complex ctan(double complex z)
+{
+       z = ctanh(cpack(-cimag(z), creal(z)));
+       return cpack(cimag(z), -creal(z));
+}