hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_specfun_bessel_j_seq_complex (s18gk)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

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

Syntax

[b, ifail] = s18gk(z, a, nl)
[b, ifail] = nag_specfun_bessel_j_seq_complex(z, a, nl)

Description

nag_specfun_bessel_j_seq_complex (s18gk) 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 function may also be called with z=0, since Jq0=0 when q>0. For negative orders the formula
J-qz=cosπqJqz-sinπqYqz  
is used to generate the required sequence. The appropriate values of Jqz and Yqz are obtained by calls to nag_specfun_bessel_y_complex (s17dc) and nag_specfun_bessel_j_complex (s17de).

References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications

Parameters

Compulsory Input Parameters

1:     z – complex scalar
The argument z of the function.
Constraint: z0.0,0.0 when nl<0.
2:     a – double scalar
The order α of the first member in the required sequence of function values.
Constraint: 0.0a<1.0.
3:     nl int64int32nag_int scalar
The value of N.
Constraint: absnl101.

Optional Input Parameters

None.

Output Parameters

1:     babsnl+1 – complex array
With ifail=0 or 3, the required sequence of function values: bn contains J α+n-1 z if nl0 and J α-n+1 z otherwise, for n=1,2,,absnl+1.
2:     ifail int64int32nag_int scalar
ifail=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

Errors or warnings detected by the function:

Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.

   ifail=1
On entry,z=0.0,0.0 when nl<0,
ora<0.0,
ora1.0,
orabsnl>101.
   ifail=2
The computation has been abandoned due to the likelihood of overflow.
W  ifail=3
The computation has been completed but some precision has been lost.
   ifail=4
The computation has been abandoned due to total loss of precision.
   ifail=5
The computation has been abandoned due to failure to satisfy the termination condition.
   ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
   ifail=-399
Your licence key may have expired or may not have been installed correctly.
   ifail=-999
Dynamic memory allocation failed.

Accuracy

All constants in nag_specfun_bessel_y_complex (s17dc) and nag_specfun_bessel_j_complex (s17de) 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=mint,18. Because of errors in argument reduction when computing elementary functions inside nag_specfun_bessel_y_complex (s17dc) and nag_specfun_bessel_j_complex (s17de), the actual number of correct digits is limited, in general, by p-s, where s max1,log10z,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.

Further Comments

None.

Example

This example evaluates J0z,J1z,J2z and J3z at z=0.6-0.8i, and prints the results.
function s18gk_example


fprintf('s18gk example results\n\n');

z =  0.6 - 0.8i;
a = 0;
nl = int64(3);

[b, ifail] = s18gk(z, a, nl);

fprintf('   alpha        J_alpha(%5.1f%+5.1fi)\n',real(z), imag(z));
for j=1:nl+1
  fprintf('%10.2e   %12.4e%+12.4ei\n', a+double(j-1), real(b(j)), imag(b(j)));
end


s18gk example results

   alpha        J_alpha(  0.6 -0.8i)
  0.00e+00     1.0565e+00 +2.4811e-01i
  1.00e+00     3.5825e-01 -3.7539e-01i
  2.00e+00    -2.5974e-02 -1.2538e-01i
  3.00e+00    -1.9369e-02 -8.6380e-03i

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015