summaryrefslogtreecommitdiff
path: root/src/complex/casinf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/complex/casinf.c')
-rw-r--r--src/complex/casinf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/complex/casinf.c b/src/complex/casinf.c
new file mode 100644
index 00000000..cb9863f6
--- /dev/null
+++ b/src/complex/casinf.c
@@ -0,0 +1,14 @@
+#include "libm.h"
+
+// FIXME
+
+float complex casinf(float complex z)
+{
+ float complex w;
+ float x, y;
+
+ x = crealf(z);
+ y = cimagf(z);
+ w = cpackf(1.0 - (x - y)*(x + y), -2.0*x*y);
+ return clogf(cpackf(-y, x) + csqrtf(w));
+}