exp(i*x)
is cos(x)
+ i*sin(x)
. A good math library will calculate cos(x)
and sin(x)
correctly even when x
is large. E.g., you should get correct results with the OS X or iOS standard math library, within a few ULP.
In C, this should work:
#include <complex.h>
…
double complex Y = cexp(I * x);