On Sat, May 16, 2009 at 12:30 PM, Ondrej Certik <ond...@certik.cz> wrote: >> Numerically, there's no point implementing spherical Bessel functions using >> any other formula than sqrt(pi/2/z)*besselj(v+0.5,z), >> except adding some additional code to handle special cases. > > That boils down to calling hyper() in mpmath/functions.py. The > question is whether that is faster than just evaluating one sin, one > cos and two simple polynomials. > > e.g. is hyper comparably fast as for example sin? Or is it for example > 3x slower?
It's quite a bit slower, but so is evaluating a polynomial. The expanded formula is probably faster only for n <= N where N = 2-3 or so. mpmath.besselj could be improved to use faster series code for half-integer arguments (as it does for integer arguments). Then the benefits would immediately apply to both besselj and spherical Bessel functions. Fredrik --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy-patches" group. To post to this group, send email to sympy-patches@googlegroups.com To unsubscribe from this group, send email to sympy-patches+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sympy-patches?hl=en -~----------~----~----~----~------~----~------~--~---