From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/complex/cacos.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/complex/cacos.c (limited to 'src/complex/cacos.c') diff --git a/src/complex/cacos.c b/src/complex/cacos.c new file mode 100644 index 0000000..c39d257 --- /dev/null +++ b/src/complex/cacos.c @@ -0,0 +1,11 @@ +#include "complex_impl.h" + +// FIXME: Hull et al. "Implementing the complex arcsine and arccosine functions using exception handling" 1997 + +/* acos(z) = pi/2 - asin(z) */ + +double complex cacos(double complex z) +{ + z = casin(z); + return CMPLX(M_PI_2 - creal(z), -cimag(z)); +} -- cgit v1.2.3