Expand description
§Bessel Zeros
A crate for finding the zeros of the Bessel functions.
This crate uses the routine described in: “An Algorithm with ALGOL 60 Program for the Computation of the zeros of the Ordinary Bessel Functions and those of their Derivatives”. N. M. Temme Journal of Computational Physics, 32, 270-279 (1979)
This crate is inspired by (via several intermediate steps) Adam Wyatt’s Matlab version of this code.
§Backends
Two backends are available:
| Backend | Module / functions | Order type | Speed |
|---|---|---|---|
AMOS (amos-bessel-rs) | crate root | any f64-compatible | slower |
| real-bessel | fast sub-module | i32 only | faster |
§Primary API (AMOS backend — any real order)
bessel_zeros_jbessel_zeros_ybessel_zeros_jpbessel_zeros_ypbessel_zeros— lower-level, accepts aBesselFunTypeand custom precision
§Fast API (real-bessel backend — integer orders only)
Use the fast sub-module for the same functions with integer orders:
use bessel_zeros::fast;
let zeros = fast::bessel_zeros_j(0, 5);
assert_eq!(zeros.len(), 5);
assert!((zeros[0] - 2.40482555769577).abs() < 1e-10);§Example (AMOS backend, non-integer order)
use bessel_zeros::bessel_zeros_j;
let zeros = bessel_zeros_j(0.5_f64, 5);
assert_eq!(zeros.len(), 5);Modules§
- fast
- Fast Bessel zero computation using the
real-besselbackend.
Enums§
- Bessel
FunType - The type of Bessel function of which to find the zeros.
Constants§
- DEFAULT_
PRECISION - Default relative error tolerance used by the convenience functions
(
bessel_zeros_j,bessel_zeros_y,bessel_zeros_jp,bessel_zeros_yp). Pass a custom value tobessel_zerosif you need different precision.
Functions§
- bessel_
zeros - Finds the first
n_zeroszeros of the specified Bessel function. - bessel_
zeros_ j - Calculates the zeros of the Bessel function of the given kind and
order. - bessel_
zeros_ jp - Finds the first
n_zeroszeros of the derivative of Jv(x). - bessel_
zeros_ y - Finds the first
n_zeroszeros of the Bessel function of the second kind Yv(x). - bessel_
zeros_ yp - Finds the first
n_zeroszeros of the derivative of Yv(x).