What is the most efficient way to numerically compute the sine of a complex number?
Suppose I want to calculate the sine of a complex number a + bi on a computer. Suppose that a and b are both floating point numbers with a limited precision and I want to compute the real and complex parts of the sine of a + bi.
I'm sure that there are many ways to break this down, but supposing that I have functions available in a library that compute exponents and trig functions of real numbers, how can I go about computing the sine of a complex number?
You can use the usual trigonometric formulas ($\cos(a+b)=\cos a \cos b-\sin a\sin b$, etc.), and you also need:
$$\cos ix=\mathrm{cosh}\, x$$
$$\sin ix=i \,\mathrm{sinh}\, x$$
They are direct consequences of the definition of $e^z$ (and then trigonometric and hyperbolic functions) as a series.
Thus, for example,
$$\cos(a+ib)=\cos a\,\mathrm{cosh}\,b-i\sin a\,\mathrm{sinh}\, b$$