blob: 918717bfcc42233dfdb83493002ea4ca187bde93 [file] [log] [blame]
Szabolcs Nagy2d72b582018-11-29 22:09:53 +00001#include "complex_impl.h"
Rich Felkerb69f6952012-03-13 01:17:53 -04002
3/* tan(z) = -i tanh(i z) */
4
5double complex ctan(double complex z)
6{
Szabolcs Nagycfbaba72012-11-13 01:31:49 +01007 z = ctanh(CMPLX(-cimag(z), creal(z)));
8 return CMPLX(cimag(z), -creal(z));
Rich Felkerb69f6952012-03-13 01:17:53 -04009}