-- the two methods for large l, against values of j_l(x) to 15 digits for _, r in ipairs({{5, 2, 2.63516977024412e-3}, {20, 11.88, 4.33642532610588e-5}, {30, 17, 4.24200329973575e-7}}) do local l, x, exact = r[1], r[2], r[3] local rec = math.SphericalBesselJ(l, x) local ser = math.SphericalBesselJ(l, x, {{"Method", "Series"}}) print(string.format("j_%d(%g) = %.14e Recurrence %.14e Series %.14e", l, x, exact, rec, ser)) end