#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));
}