extend cmath (some of the functions are dummy)
[libm] / src / cmath / ctan.c
index 4462ef0..4741a4d 100644 (file)
@@ -1,9 +1,9 @@
 #include "libm.h"
 
+/* tan(z) = -i tanh(i z) */
+
 double complex ctan(double complex z)
 {
-       double complex r;
-
-       r = ctanh(cpack(-cimag(z), creal(z)));
-       return cpack(cimag(r), -creal(r));
+       z = ctanh(cpack(-cimag(z), creal(z)));
+       return cpack(cimag(z), -creal(z));
 }