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

Hankel functions sometimes throw NaN values #111

Open
olaca09 opened this issue Mar 4, 2024 · 1 comment
Open

Hankel functions sometimes throw NaN values #111

olaca09 opened this issue Mar 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@olaca09
Copy link

olaca09 commented Mar 4, 2024

I recently bumped into hankelh1() and hankelh2() returning NaN real parts for nu = 7, x= \sqrt(15^2-1). Values close to this point both in nu and x behave nicely. Is besseljy() behaving badly here for whatever reason?

julia> import SpecialFunctions
julia> import Bessels
julia> x = sqrt(15^2 - 1);
julia> SpecialFunctions.besselh(7, 1, x)
0.028099885144514142 - 0.21733228481429356im

julia> Bessels.hankelh1(7, x)
NaN - 0.2173322848142936im

Perhaps I'll try some troubleshooting myself soon, but I figured I'd make sure I'm not misunderstanding something simple here.

@heltonmc
Copy link
Member

heltonmc commented Mar 4, 2024

No this is indeed a bug! Thank you for the report. What is happening is in the continued fraction


at these specific values b=d causing infinities to propagate through and return NaN

@heltonmc heltonmc added the bug Something isn't working label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants