# Why is the Spherical Bessel Function acting strangely at this point?

I'm doing some computation that requires the use of Spherical Bessel Functions of the 1st kind, at high orders and values.

So, I managed to find this, while running it over a wide range of values. I hit an unexpected 0:

In:= SphericalBesselJ[210, (1/1.5)*2*Pi*1.5*1000/40] // InputForm

Out//InputForm=
0.


For explaining this, (1/1.5)*2*Pi*1.5*1000/40 is about 157.08.

That was strange to me, so I plotted it from 157 to 157.1. It looks smooth, no crazy behavior or zeros.

Trying it slightly on either side of this supposed 0:

In:= SphericalBesselJ[210, (1/1.5)*2*Pi*1.5*1000/40 - .0001] // InputForm

Out//InputForm=
9.476205413946214*^-16

In:= SphericalBesselJ[210, (1/1.5)*2*Pi*1.5*1000/40 + .0001] // InputForm

Out//InputForm=
9.477897706291978*^-16


In fact, I just realized that it does the same thing for all n (the first argument) greater than 200. I can't find anything on the Mathematica page for this function... am I missing something obvious, like I usually am?

thanks!

edit: Some further poking has revealed that I can also get it to work for n = 71 (for some different values of the second argument). I'm very confused now.

## 1 Answer

SphericalBesselJ[210, (1/1.5)*2*Pi*1.5*1000/40] // InputForm


0.

Use higher precision input

SphericalBesselJ[210, (1/1.520)*2*Pi*1.520*1000/40] // InputForm


9.47705152294778379274390.13632911832271324*^-16

SphericalBesselJ[210, (2/3)*2*Pi*(3/2)*1000/40] // N[#, 20] & // InputForm


9.4770515229477837927439502834934033492858920.*^-16

SphericalBesselJ[210, Rationalize[(1/1.5)*2*Pi*1.5*1000/40, 0]] //
N[#, 20] & // InputForm


9.47705152294788077853004102494861628934812220.*^-16

Plot[SphericalBesselJ[210, k], {k, 156, 158}, WorkingPrecision -> 20,
PlotPoints -> 51] • Maybe it's worth pointing to the documentation of SetPrecision. (+1). – Jens Apr 15 '15 at 23:15
• Ahhh, thank you, I should have known. I've been tricked by this before, but I thought I was being careful, checking with InputForm. But I'm still a little confused, why is it going to 0? Why do we find some anomalous point like that? – YungHummmma Apr 15 '15 at 23:16
• See reference.wolfram.com/language/tutorial/… "In most cases, built-in Wolfram Language functions will give you results that have as much precision as can be justified on the basis of your input. ... If you give higher-precision input, the Wolfram Language will use higher precision in its internal calculations, and you will usually be able to get a higher-precision result." You gave very low precision inputs and the resulting precision only justified a 0.` result. – Bob Hanlon Apr 15 '15 at 23:58