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

zeros of Bessel J function #89

Open
jlapeyre opened this issue Apr 18, 2018 · 2 comments
Open

zeros of Bessel J function #89

jlapeyre opened this issue Apr 18, 2018 · 2 comments

Comments

@jlapeyre
Copy link

Here is code to compute zeros of the besselj function. Are you interested in a PR ?

It could be more efficient, maybe cache some of first zeros. But, it works. The asymptotic formula happens to land in the basin of the correct zero, even for the first zero. It then uses root finding.

@jtravs
Copy link

jtravs commented Sep 9, 2018

I'd find this really useful.

@jlapeyre
Copy link
Author

I added support for Bessel functions of the second kind bessely_zero to FunctionZeros.jl. In testing it, I discovered an error in bessely in mpath.

I mentioned it might be kinda slow because I only use root finding, use a slow root finder, don't supply derivatives, etc. But, its still 100x faster than mpmath.

In [4]: import mpmath

In [5]: %timeit mpmath.besseljzero(1.0,1)
1000 loops, best of 3: 484 µs per loop
julia> using FunctionZeros; using BenchmarkTools;

julia> @btime besselj_zero(1.0,1)
  3.018 μs (48 allocations: 2.16 KiB)
3.8317059702075125

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

No branches or pull requests

2 participants