bessel icon indicating copy to clipboard operation
bessel copied to clipboard

`BESSELI` gives wrong answer for some inputs

Open ArniDagur opened this issue 1 year ago • 0 comments

Examples

Excel Formula Excel Answer SheetJS Answer
=BESSELI(-13.2,3) -42092.84027 -25425.470523920318
=BESSELI(-13.8,9) -5663.903109 -3037.8756236089935
=BESSELI(-10.08,2) 2465.760003 2215.9970659564715
=BESSELI(-11.06,0) 7717.636762 6363.659791792667
=BESSELI(-9.86,4) 1061.120531 967.9812913086927
=BESSELI(-12.81,7) -5926.01108 -3838.353089311662
=BESSELI(-13.07,6) 12963.19511 8019.79800362882
=BESSELI(-14.37,7) -32766.94859 -15501.267818797078
=BESSELI(-9.02,2) 881.4361669 840.1405514233114
=BESSELI(-13.3,16) 8.029039773 4.759261926315784
=BESSELI(-13.2,0) 59922.88267 36195.423498210446
=BESSELI(-10.21,5) -974.2341176 -867.2309455734216
=BESSELI(-11.4,3) -7078.122098 -5619.615638800571
=BESSELI(-10.09,4) 1346.003156 1208.798299218855
=BESSELI(-10.78,11) -26.13731414 -22.163938968958945
=BESSELI(-9.41,11) -3.543708301 -3.3176964175025487
=BESSELI(-11.59,0) 12801.13745 9932.122603521633

When I ask scipy.special.iv, it agrees with Excel on the answer. When using that function, watch out for the arguments being switched—(n,x) rather than (x,n).

It should be noted I didn't find any bugs like this in BESSELJ, BESSELY, or BESSELK.

ArniDagur avatar Aug 03 '24 23:08 ArniDagur