aboutsummaryrefslogtreecommitdiff
path: root/src/complex/cacos.c
blob: 3d97fb806e3669206a8e8e4ae640f80f7fbd61a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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));
}


#ifdef TEST
int
main(void) {
	return 0;
}
#endif