/* * Recursive computation of (arbitrary degree) spherical Bessel/Neumann/Hankel functions, * according to Gumerov and Duraiswami, * "The Fast Multipole Methods for the Helmholtz Equation in Three Dimensions", * Elsevier, 2005. * * Implementation by Franz Zotter, Institute of Electronic Music and Acoustics * (IEM), University of Music and Dramatic Arts (KUG), Graz, Austria * http://iem.at/Members/zotter, 2007. * * This code is published under the Gnu General Public License, see * "LICENSE.txt" */ #include #include "sph_radial.h" #define EPS 1e-10 static void radialRecurrence (double x, double *y, int n); // the two recurrences for higher n: // by now no numeric stabilization for the bessel function is performed static void radialRecurrence (double x, double *y, int n) { int k; for (k=1;k=0) y[0] = (x=1) y[1] = -cos(x)/x + y[0]/x; radialRecurrence (x,y,n); } void sphNeumann (double x, double *y, int n) { if (y==0) return; if (n>=0) y[0] = -cos(x)/x; if (n>=1) y[1] = ((x