Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect cyl_bessel_j value at infinity #1143

Closed
matwey opened this issue Jun 2, 2024 · 2 comments · Fixed by #1144
Closed

Incorrect cyl_bessel_j value at infinity #1143

matwey opened this issue Jun 2, 2024 · 2 comments · Fixed by #1144

Comments

@matwey
Copy link

matwey commented Jun 2, 2024

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
Copy link
Collaborator

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

@matwey
Copy link
Author

matwey commented Jun 3, 2024

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

jzmaddock added a commit that referenced this issue Jun 7, 2024
Also sinc functions, and update tests.
Fixes #1143.
jzmaddock added a commit that referenced this issue Jun 14, 2024
* Update Bessel functions at infinity.
Also sinc functions, and update tests.
Fixes #1143.

* Correct some test failures.

* Yikes, correct missing if.

* Temporary fix for multiprecision.
REMOVE THIS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants