Rational approximation or series expansion of $K_0$ and $K_1$ for small z

161 Views Asked by At

I'm looking for a series expansion of the modified Bessel functions of second kind $K_0(z)$ and $K_1(z)$ for $$|z|<5, ~~|phase(z)| < \pi$$ My $z$ can be described as $z = a\cdot \sqrt{ix}$, where $x$ is real. The task is quite troublesome as the usual approach $$K_v(z)=\frac{\pi}{2\sin(v\pi)}[I_{-v}(z)-I_{v}(z)]$$ is not valid for integer order functions. If one calculates the limit of this equation one gets a certainly valid result, which can be found in literature. But it is rather bulky and it contains terms with $\log(0.5\cdot z)$ which is not applicable for my case. I require a rational approximation.

There is an article On the numerical evaluation of the modified bessel function of the third kind which suggests $$K_v(z) = \frac{1}{2}(\frac{z}{2})^{-v}\Gamma(v) ~~~for~~ v>0$$ which is alright for $K_1$ and |z|<3. But it's not sufficient. Do you have any ideas or sources what else to try to expand the range to |z|<5 and also for $K_0$?

Edit: I also found the article Rational approximations for the modified Bessel function of the second kind which seemed to offer a good solution. But I implemented it in Matlab and got a quite weird behavior, I assume caused by overflow.