boostorg / math

Boost.org math module
http://boost.org/libs/math
Boost Software License 1.0
313 stars 225 forks source link

Incorrect `cyl_bessel_j` value at infinity #1143

Closed matwey closed 5 months ago

matwey commented 5 months ago

Hello,

I use the following code with boost 1.83.0

std::cout << boost::math::cyl_bessel_j(0, std::numeric_limits<double>::infinity()) << std::endl;
std::cout << boost::math::cyl_bessel_j(1, std::numeric_limits<double>::infinity()) << std::endl;

and then I see

-nan
-nan

while Bessel J function of any order is known to be exactly zero at infinity.

jzmaddock commented 5 months ago

Confirmed, I'll check the other Bessel functions while I'm at it. Thanks for the report!

matwey commented 5 months ago

Thanks. I've found that at least sinc_pi is also not defined correctly for infinity.