I asked this question on the Computer Science stack exchange (https://cs.stackexchange.com/questions/128710/faster-computation-of-ke-x-h2), but it appears that it is more appropriate in Computational Science stack.
Essentially, I want to compute $$f(x) =\sum^n_{i = 0} k_ie^{-(x - h_i)^2},$$ where $n \geq 0$ and $k$ and $h$ are both real numbers, for various $x.$ On average, I would expect $x$ to lie between the minimum and maximum $h_i,$ $x \in (\epsilon + \min h_i, \epsilon + \max h_i).$
I want to compute this method without having to repeatedly call $\exp(x).$ Is there a way to compress this series?
If it boils down to approximating $\exp(x),$ then I would like to note that polynomial approximations will not work.