sin 2A = 2 sin A cos A
cos 2A = (cos A)^2 - (sin A)^2
If you are happy using sine of small x is x and cosine of small x is 1 as your base cases, you can write sine and cosine as mutually recursive functions:
(defun sin (z)
(if (small z)
z
(* 2
(sin (half z))
(cos (half z)))))
(defun cos (z)
(if (small z)
1
(- (square (cos (half z)))
(square (sin (half z))))))
(sin pi) => 6.167817939221069d-7 quite close to zero
(cos pi) => -1.0012055113842453d0 you can get this
much closer to -1 by using 1-x^2/2 as your base case.It had never occurred to me to do exponential the same way, as
(defun exp (z)
(if (small z)
(+ 1 z)
(square (exp (half z)))))
So it is a bit of a shock to try it and see it work just fine for complex numbers(exp (complex 0 pi)) => #C(-1.0012055113842453d0 6.167817939221069d-7)