about summary refs log tree commit diff
path: root/src/complex/csin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/complex/csin.c')
-rw-r--r--src/complex/csin.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/complex/csin.c b/src/complex/csin.c
new file mode 100644
index 00000000..246a4595
--- /dev/null
+++ b/src/complex/csin.c
@@ -0,0 +1,9 @@
+#include "libm.h"
+
+/* sin(z) = -i sinh(i z) */
+
+double complex csin(double complex z)
+{
+	z = csinh(cpack(-cimag(z), creal(z)));
+	return cpack(cimag(z), -creal(z));
+}