Skip to content

Conversation

simonp0420
Copy link
Contributor

@simonp0420 simonp0420 commented Oct 17, 2025

Add methods to bessel_zero_asymptotic and bessel_deriv_zero_asymptotic that promote nu from Integer to float. Fixes Issue #27

@simonp0420
Copy link
Contributor Author

simonp0420 commented Oct 17, 2025

I submitted this PR a little too early. All tests ran successfully on my machine where Int === Int64, but I see some have failed in CI on x86 machines, where Int === Int32, and the @test_broken tests are actually no longer broken. I also now see from the comments preceding the "high nu" test set that Issue #27 is a duplicate of Issue #10. I'll modify this PR to replace the @test_broken tests to @test after which I think everything should work ok.

@simonp0420 simonp0420 changed the title Fix Issue #27 WIP: Fix Issue #27 Oct 17, 2025
@simonp0420
Copy link
Contributor Author

Edit: Changing this to a WIP (Work In Progress) PR since the problem still occurs for even higher nu values. Please don't merge yet.

@simonp0420
Copy link
Contributor Author

simonp0420 commented Oct 19, 2025

Ok, I've implemented an asymptotic formula from DLMF that is appropriate for large nu and small n. Now the first three zeros of any of the four treated functions are returned correctly for any positive nu value. All zeros are returned correctly for nu less than or equal to 93.

Here is an example of finding the correct first three zeros for a high-order Bessel function:

julia> using FunctionZeros, SpecialFunctions, Plots

julia> t = [bessely_deriv_zero(500, n) for n in 1:3]
3-element Vector{Float64}:
 514.5723799304565
 526.0501131866687
 535.4459280973557

julia> bessely_deriv(nu, x) = 0.5 * (bessely(nu-1, x) - bessely(nu+1, x))
bessely_deriv (generic function with 1 method)

julia> bessely_deriv.(500, t)
3-element Vector{Float64}:
 -2.6506574712925612e-15
  6.893097204141441e-14
 -2.5673907444456745e-16

julia> plot(range(500, 550, 100), x -> bessely_deriv(500, x)); scatter!(t, zeros(length(t)))
image
  • Removed WIP from title of PR.
  • Please review

@simonp0420 simonp0420 changed the title WIP: Fix Issue #27 Fix Issue #27 Oct 20, 2025
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 this pull request may close these issues.

1 participant