Lentz's algorithm
In mathematics, Lentz's algorithm is an algorithm to evaluate continued fractions and compute tables of spherical Bessel functions. History. The idea was introduced in 1973 by William J. Lentz and was simplified by him in 1982. Lentz suggested that calculating ratios of spherical Bessel functions of complex arguments can be difficult. He developed a new continued fraction technique for calculating them. This method was an improvement compared to other methods because it eliminated errors on certain terms or provided zero as a result. The original algorithm assumes that the denominators occurring during execution remain non-zero  throughout. Improvements to overcome this limitation include an altered recurrence relation suggested by Jaaskelainen and Ruuskanen in 1981 or a simple shift of the denominator by a very small number as suggested by Thompson and Barnett in 1986. Initial work. This theory was initially motivated by Lentz's other research when he calculated ratios of Bessel function necessary for Mie scattering. He demonstrated that the algorithm uses a technique involving the evaluation continued fractions that starts from the beginning and not at the tail. In addition, continued fraction representations for both ratios of Bessel functions and spherical Bessel functions of  consecutive order can be computed with Lentz's algorithm. The algorithm suggested that it is possible to terminate the evaluation of continued fractions when formula_1 is relatively small. Algorithm. Lentz's algorithm is based on the Wallis-Euler relations. If