s17al determines the leading n zeros of one of the Bessel functions Jαx, Yαx, Jαx or Yαx for real x and non-negative α.

Syntax

C#
public static void s17al(
	double a,
	int n,
	int mode,
	double rel,
	double[] x,
	out int ifail
)
Visual Basic
Public Shared Sub s17al ( _
	a As Double, _
	n As Integer, _
	mode As Integer, _
	rel As Double, _
	x As Double(), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void s17al(
	double a, 
	int n, 
	int mode, 
	double rel, 
	array<double>^ x, 
	[OutAttribute] int% ifail
)
F#
static member s17al : 
        a : float * 
        n : int * 
        mode : int * 
        rel : float * 
        x : float[] * 
        ifail : int byref -> unit 

Parameters

a
Type: System..::..Double
On entry: the order α of the function.
Constraint: 0.0a100000.0.
n
Type: System..::..Int32
On entry: the number N of zeros required.
Constraint: n1.
mode
Type: System..::..Int32
On entry: specifies the form of the function whose zeros are required.
mode=1
The zeros of Jαx are required.
mode=2
The zeros of Yαx are required;
mode=3
The zeros of Jαx are required;
mode=4
The zeros of Yαx are required.
Constraint: 1mode4.
rel
Type: System..::..Double
On entry: the relative accuracy to which the zeros are required.
Suggested value: the square root of the machine precision.
Constraint: rel>0.0.
x
Type: array<System..::..Double>[]()[][]
An array of size [n]
On exit: the N required zeros of the function specified by mode.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

s17al attempts to find the leading N zeros of one of the Bessel functions Jαx, Yαx, Jαx or Yαx, where x is real. When α is real, these functions each have an infinite number of real zeros, all of which are simple with the possible exception of x=0. If α0, the nth positive zero is denoted by jα,n,jα,n,yα,n and yα,n, respectively, for n=1,2,,N, except that x=0 is counted as the first zero of Jαx when α=0. Since J0x=-J1x, it therefore follows that j0,1=0 and j0,n=-j1,n-1 for n=2,3,,N-1. Further details can be found in Section 9.5 of Abramowitz and Stegun (1972).
s17al is based on Algol 60 procedures given by Temme (1979). Initial approximations to the zeros are computed from asymptotic expansions. These are then improved by higher-order Newton iteration making use of the differential equation for the Bessel functions.

References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Temme N M (1976) On the numerical evaluation of the ordinary Bessel function of the second kind J. Comput. Phys. 21 343–350
Temme N M (1979) An algorithm with Algol 60 program for the computation of the zeros of ordinary Bessel functions and those of their derivatives J. Comput. Phys. 32 270–279

Error Indicators and Warnings

Errors or warnings detected by the method:
ifail=1
On entry,a<0.0,
ora>100000.0,
orn0,
ormode<1,
ormode>4,
orrel0.0.
ifail=-9000
An error occured, see message report.
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

If the value of rel is set to 10-d, then the required zeros should have approximately d correct significant digits.

Parallelism and Performance

None.

Further Comments

None.

Example

This example determines the leading five positive zeros of the Bessel function J0x.

Example program (C#): s17ale.cs

Example program data: s17ale.d

Example program results: s17ale.r

See Also