Efficient Multi-Precision Computation of Bessel Functions for Real Orders and Complex Arguments with Fortran Implementation -- Part II: The Modified Bessel Function of the Second Kind, $K_ν(z)$
This work provides a reliable, high-performance computational tool for scientists and engineers needing accurate Bessel function evaluations across challenging parameter regimes.
This paper presents an efficient algorithm for computing the modified Bessel function of the second kind for complex arguments and real orders, with a Fortran implementation supporting double and quadruple precision. The method achieves high accuracy and significantly faster runtimes compared to established methods, avoiding numerical failure modes across wide parameter ranges.
This paper, the second in a series, presents an efficient, self-contained algorithm for computing the modified Bessel function of the second kind, \(K_ν(z)\) for complex argument and real orders, building on Part~I (for \(I_ν\)). The method adaptively selects among analytic representations such as power series, large-\(|z|\) asymptotics, uniform asymptotics for large \(|ν|\), and numerically stable forward recurrence with region boundaries tuned for accuracy and efficiency. A robust \texttt{Fortran} implementation supports double precision and quadruple precision. The use of quadruple precision extends the reliable computational domain and improves stability in challenging regimes. Accuracy is validated against high-precision \texttt{Maple} results, and benchmarks show runtimes significantly superior to those of established methods, in the literature, while avoiding their numerical failure modes across several decades of the parameter domain. Together with Part~I, this work provides a comprehensive, multiple-precision toolkit for \(\{I_ν,K_ν\}\) across wide parameter ranges.