I'm looking to compute $f(\theta):= \mathrm{erfi}(\theta)\exp(-\theta^2)$ as efficiently as possible, to double precision, with a fairly wide radius of converge.
Computing $\mathrm{erfi}(\theta)$ and then $\exp(-\theta^2)$ is disastrous, as one is in general huge and the other tiny, leading to overflow, then underflow, and a nan result.
The Taylor series of $f$, although having an infinite radius of convergence, has low order terms that easily overflow 64 bit doubles for large $\theta$, making it a pain to use.
What are the alternatives? C, C++, Python, and pure mathematics welcome.
(I have my own algorithm, using the Taylor series, that converges using long double intermediate values which converges for $|\theta| < 7$, but this isn't enough!)
For $s \ge 10$, the following approximation to $f(s)$ (from a Chebyshev series of $f(1/t)$) is accurate to within about $1.468 \times 10^{-17}$.