I'm trying to optimize evaluation of an integral (scipy.integrate.quad) over a function containing Bessel functions with Numba.
While Numba seems to work well for "common" numpy functions, it throws an error when I attempt to include the Bessel function:
Untyped global name 'jn': cannot determine Numba type of <class 'numpy.ufunc'>
From a bit of Googling, I have found a Jupyter notebook from the Numba repository that discusses making a j0 function (https://github.com/numba/numba/blob/08d5c889491213288be0d5c7d726c4c34221c35b/examples/notebooks/j0%20in%20Numba.ipynb).
The notebook comments that making the function in numba will be fast, yet the timing results they show at the end indicate ~100x slower performance with numba. Am I missing something obvious here?
And more generally, is it possible to benefit from Numba compiling for scipy Bessel functions?