about summary refs log tree commit diff
path: root/src/complex/cacosl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/complex/cacosl.c')
-rw-r--r--src/complex/cacosl.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/complex/cacosl.c b/src/complex/cacosl.c
new file mode 100644
index 00000000..5992e056
--- /dev/null
+++ b/src/complex/cacosl.c
@@ -0,0 +1,16 @@
+#include "libm.h"
+
+#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
+long double complex cacosl(long double complex z)
+{
+	return cacos(z);
+}
+#else
+// FIXME
+#define PI_2 1.57079632679489661923132169163975144L
+long double complex cacosl(long double complex z)
+{
+	z = casinl(z);
+	return cpackl(PI_2 - creall(z), -cimagl(z));
+}
+#endif