NAG CL Interface
s18ehc (nag_bessel_k_alpha_scaled)

Settings help

CL Name Style:


1 Purpose

s18ehc returns a sequence of values for the scaled modified Bessel functions e x K α+n (x) for real x>0 , selected values of α0 and n = 0 , 1 , , N .

2 Specification

#include <nag.h>
void  s18ehc (double x, Integer ia, Integer ja, Integer nl, double b[], NagError *fail)
The function may be called by the names: s18ehc or nag_bessel_k_alpha_scaled.

3 Description

s18ehc evaluates a sequence of values for the scaled modified Bessel function of the second kind e x K α (x) , where x is real and non-negative and α {0, 1 2 , 1 3 , 1 4 , 2 3 , 3 4 } is the order. The (N+1) -member sequence is generated for orders α , α + 1 , , α + N .

4 References

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

5 Arguments

1: x double Input
On entry: the argument x of the function.
Constraint: x>0.0 .
2: ia Integer Input
3: ja Integer Input
On entry: the numerator i and denominator j , respectively, of the order α = i / j of the first member in the required sequence of function values. Only the following combinations of pairs of values of i and j are allowed:
  • i=0 and j=1 corresponds to α=0 ;
  • i=1 and j=2 corresponds to α = 1 2 ;
  • i=1 and j=3 corresponds to α = 1 3 ;
  • i=1 and j=4 corresponds to α = 1 4 ;
  • i=2 and j=3 corresponds to α = 2 3 ;
  • i=3 and j=4 corresponds to α = 3 4 .
Constraint: ia and ja must constitute a valid pair (ia,ja) = (0,1) , (1,2) , (1,3) , (1,4) , (2,3) or (3,4) .
4: nl Integer Input
On entry: the value of N . Note that the order of the last member in the required sequence of function values is given by α+N .
Constraint: 0 nl 100 .
5: b[nl+1] double Output
On exit: with fail.code=NE_NOERROR or fail.code=NW_SOME_PRECISION_LOSS , the required sequence of function values: b (n) contains K α+n (x) , for n = 0 , 1 , , N .
6: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

NE_INT
On entry, nl=value .
Constraint: 0 nl 100 .
NE_INT_2
On entry, ia=value , ja=value .
Constraint: ia and ja must constitute a valid pair (ia,ja).
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.
NE_OVERFLOW_LIKELY
The evaluation has been abandoned due to the likelihood of overflow.
NE_REAL
On entry, x=value .
Constraint: x>0.0 .
NE_TERMINATION_FAILURE
The evaluation has been abandoned due to failure to satisfy the termination condition.
NE_TOTAL_PRECISION_LOSS
The evaluation has been abandoned due to total loss of precision.
NW_SOME_PRECISION_LOSS
The evaluation has been completed but some precision has been lost.

7 Accuracy

All constants in the underlying function 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 the underlying function, the actual number of correct digits is limited, in general, by p-s , where s max(1,|log10x|) represents the number of digits lost due to the argument reduction. Thus the larger the value of x , the less the precision in the result.

8 Parallelism and Performance

s18ehc is not threaded in any implementation.

9 Further Comments

None.

10 Example

The example program evaluates e x K 0 (x) , e x K 1 (x) , e x K 2 (x) and e x K 3 (x) at x=0.5 , and prints the results.

10.1 Program Text

Program Text (s18ehce.c)

10.2 Program Data

Program Data (s18ehce.d)

10.3 Program Results

Program Results (s18ehce.r)