about summary refs log tree commit diff
path: root/src/complex/casinl.c
blob: 072adc450d2b0ac6c224c734469b3b82f79d537a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "complex_impl.h"

#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
long double complex casinl(long double complex z)
{
	return casin(z);
}
#else
// FIXME
long double complex casinl(long double complex z)
{
	long double complex w;
	long double x, y;

	x = creall(z);
	y = cimagl(z);
	w = CMPLXL(1.0 - (x - y)*(x + y), -2.0*x*y);
	long double complex r = clogl(CMPLXL(-y, x) + csqrtl(w));
	return CMPLXL(cimagl(r), -creall(r));
}
#endif