For reasons to do with extending the range of applicability of this Mathematica package, I would like to have a good handle on the numerical evaluation of functions of the form $$ f(x) = \frac{j_n(\sqrt{x^2-\zeta^2})}{e^{\zeta}}, $$ where $j_n$ is a spherical Bessel function of the first kind, $x$ is real-valued and reasonably small (say, in the range 0-10 or so) and $\zeta$ is a large real number (larger than $x$, and say, around 50 to 100).
From a mathematical point of view, $f(x)$ isn't particularly problematic and it does not involve any exponential catastrophes, since for $\zeta \gg x$ we have $\sqrt{x^2-\zeta^2} \sim i(\zeta-x^2/2\zeta)$, and therefore the Bessel-function term, $$ j_n(\sqrt{x^2-\zeta^2}) \sim j_n(i(\zeta-x^2/\zeta)) %=i^n i_n^{(1)}(\zeta-x^2/2\zeta) \sim \frac{ i^n }{ 2\zeta-x^2/\zeta } e^{\zeta-x^2/\zeta}, $$ contains an asymptotic contribution of order $e^\zeta$ that cancels out with the denominator in $f(x)$.
.... however.
When I try to implement this in Mathematica, I run into its General::munfl
error, which informs me that when trying to evaluate Exp[-ζ]
the number is "is too small to represent as a normalized machine number; precision may be lost". Mathematica then sets $e^{-\zeta}$ to zero and kills the entire calculation.
What are robust ways to get around this problem, and to design a numerical approach that will handle this function well in this limit? Is there a well-established way to extract the exponential asymptotic from the Bessel function and leave behind a well-behaved remnant?