NAG FL Interface
s18gkf (bessel_​j_​seq_​complex)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

s18gkf returns a sequence of values for the Bessel functions Jα+n-1(z) or Jα-n+1(z) for complex z, non-negative α<1 and n=1,2,,|N|+1.

2 Specification

Fortran Interface
Subroutine s18gkf ( z, a, nl, b, ifail)
Integer, Intent (In) :: nl
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: a
Complex (Kind=nag_wp), Intent (In) :: z
Complex (Kind=nag_wp), Intent (Out) :: b(abs(nl)+1)
C Header Interface
#include <nag.h>
void  s18gkf_ (const Complex *z, const double *a, const Integer *nl, Complex b[], Integer *ifail)
The routine may be called by the names s18gkf or nagf_specfun_bessel_j_seq_complex.

3 Description

s18gkf evaluates a sequence of values for the Bessel function of the first kind Jα(z), where z is complex and nonzero and α is the order with 0α<1. The (|N|+1)-member sequence is generated for orders α,α+1,,α+|N| when N0. Note that + is replaced by - when N<0. For positive orders the routine may also be called with z=0, since Jq(0)=0 when q>0. For negative orders the formula
J-q(z)=cos(πq)Jq(z)-sin(πq)Yq(z)  
is used to generate the required sequence. The appropriate values of Jq(z) and Yq(z) are obtained by calls to s17dcf and s17def.

4 References

NIST Digital Library of Mathematical Functions

5 Arguments

1: z Complex (Kind=nag_wp) Input
On entry: the argument z of the function.
Constraint: z(0.0,0.0) when nl<0.
2: a Real (Kind=nag_wp) Input
On entry: the order α of the first member in the required sequence of function values.
Constraint: 0.0a<1.0.
3: nl Integer Input
On entry: the value of N.
Constraint: abs(nl)101.
4: b(abs(nl)+1) Complex (Kind=nag_wp) array Output
On exit: with ifail=0 or 3, the required sequence of function values: b(n) contains J α+n-1 (z) if nl0 and J α-n+1 (z) otherwise, for n=1,2,,abs(nl)+1.
5: ifail Integer Input/Output
On entry: ifail must be set to 0, −1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of −1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value −1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or −1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry, |nl|=value.
Constraint: |nl|101.
On entry, a=value.
Constraint: a<1.0.
On entry, a=value.
Constraint: a0.0.
On entry, nl=value.
Constraint: when nl<0, z(0.0,0.0).
ifail=2
Computation abandoned due to the likelihood of overflow.
ifail=3
Computation completed but some precision has been lost.
ifail=4
Computation abandoned due to total loss of precision.
ifail=5
Computation abandoned due to failure to satisfy the termination condition.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

All constants in s17dcf and s17def are specified to approximately 18 digits of precision. If t denotes the number of digits of precision in the floating-point arithmetic being used, then clearly the maximum number of correct digits in the results obtained is limited by p=min(t,18). Because of errors in argument reduction when computing elementary functions inside s17dcf and s17def, the actual number of correct digits is limited, in general, by p-s, where s max(1,|log10|z||,|log10|α||) represents the number of digits lost due to the argument reduction. Thus the larger the values of |z| and |α|, the less the precision in the result.

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
s18gkf is not threaded in any implementation.

9 Further Comments

None.

10 Example

This example evaluates J0(z),J1(z),J2(z) and J3(z) at z=0.6-0.8i, and prints the results.

10.1 Program Text

Program Text (s18gkfe.f90)

10.2 Program Data

Program Data (s18gkfe.d)

10.3 Program Results

Program Results (s18gkfe.r)