Hello,

As far as I know, at the origin Yn(x) is singular.

Consequently, the result you get for x=0 is wrong anyway.

There is a recursion relation for J, n/xJn=1/2(Jn-1 + Jn+1), so once

you have calculated two Jn=0,1 you can reuse these to calculate the Jn n>1

Use M_PI instead of your own definition.

Hope this helps.

Johan