extend cmath (some of the functions are dummy)
[libm] / src / cmath / casinf.c
diff --git a/src/cmath/casinf.c b/src/cmath/casinf.c
new file mode 100644 (file)
index 0000000..cb9863f
--- /dev/null
@@ -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));
+}