summaryrefslogtreecommitdiff
path: root/lib/libm/csin.c
blob: 7c9b3b460224cce118d4a0300b751d13f143f929 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include "__complex.h" // for cchsh

#include <complex.h> // for creal, complex, cimag, csin, I
#include <math.h>    // for cos, sin

double complex csin(double complex z)
{
	double ch, sh;
	cchsh(cimag(z), &ch, &sh);
	return sin(creal(z)) * ch + (cos(creal(z)) * sh) * (double complex)I;
}