cos/sin for real call exp
Altered tolerance so that roots(cos(π/2*x)) gives ±1