I have a finite series that looks like this:$f(t) = \sum^n_{i=0} A_i cos(\Theta_i + \omega_i t) + B_i sin(\Theta_i + \omega_i t)$That is, a finite series of pairs of phasors.What's the state of the art for numerically calculating the value of the series at a given $t$?  I'm interested in numerically finding the root of this series, so it's important to minimize numerical inaccuracies, particularly around the zeroes.Just naively performing the cosine and sine calls produces a lot of numerical noise, which causes my root finding to fail.  I've built up a solution that works using Kahan summation and various trig identities (see this), but it's really, really slow.The N I have is not very large, so an answer doesn't have to necessarily scale well to more terms.If anyone knows any links or papers that are relevant I'd appreciate it.
Computing linear combinations of sines and cosines (phasors)
numerical analysis