NAG Library Function Document

nag_bessel_zeros (s17alc)

 Contents

    1  Purpose
    7  Accuracy

1
Purpose

nag_bessel_zeros (s17alc) 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 α.

2
Specification

#include <nag.h>
#include <nags.h>
void  nag_bessel_zeros (double a, Integer n, Integer mode, double rel, double x[], NagError *fail)

3
Description

nag_bessel_zeros (s17alc) 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).
nag_bessel_zeros (s17alc) 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.

4
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

5
Arguments

1:     a doubleInput
On entry: the order α of the function.
Constraint: 0.0a100000.0.
2:     n IntegerInput
On entry: the number N of zeros required.
Constraint: n1.
3:     mode IntegerInput
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.
4:     rel doubleInput
On entry: the relative accuracy to which the zeros are required.
Suggested value: the square root of the machine precision.
Constraint: rel>0.0.
5:     x[n] doubleOutput
On exit: the N required zeros of the function specified by mode.
6:     fail NagError *Input/Output
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).

6
Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, mode=value.
Constraint: mode4.
On entry, mode=value.
Constraint: mode1.
On entry, n=value.
Constraint: n1.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
NE_REAL
On entry, a=value.
Constraint: a100000.0.
On entry, a=value.
Constraint: a0.0.
On entry, rel=value.
Constraint: rel>0.0.

7
Accuracy

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

8
Parallelism and Performance

nag_bessel_zeros (s17alc) is not threaded in any implementation.

9
Further Comments

None.

10
Example

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

10.1
Program Text

Program Text (s17alce.c)

10.2
Program Data

Program Data (s17alce.d)

10.3
Program Results

Program Results (s17alce.r)

© The Numerical Algorithms Group Ltd, Oxford, UK. 2017