NAG CL Interface
s18ecc (nag_bessel_i_nu_scaled)

Settings help

CL Name Style:


1 Purpose

s18ecc returns the value of the scaled modified Bessel function e -x I ν/4 (x) for real x>0 .

2 Specification

#include <nag.h>
double  s18ecc (double x, Integer nu, NagError *fail)
The function may be called by the names: s18ecc or nag_bessel_i_nu_scaled.

3 Description

s18ecc evaluates an approximation to the scaled modified Bessel function of the first kind e -x I ν/4 (x) , where the order ν = −3 , −2 , −1 , 1 , 2 or 3 and x is real and positive. For positive orders it may also be called with x=0 , since I ν/4 (0) = 0 when ν>0 . For negative orders the formula
I - ν / 4 (x) = I ν/4 (x) + 2 π sin( πν 4 ) K ν/4 (x)  
is used prior to multiplication by the scale factor e -x .

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.
Constraints:
  • if nu<0 , x>0.0 ;
  • if nu>0 , x0.0 .
2: nu Integer Input
On entry: the argument ν of the function.
Constraint: 1 abs(nu) 3 .
3: 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, nu=value .
Constraint: 1 abs(nu) 3 .
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. The result is returned as zero.
NE_REAL_INT
On entry, x=value , nu=value .
Constraint: x>0.0 when nu<0 .
On entry, x=value , nu=value .
Constraint: x0.0 when nu>0 .
NE_TERMINATION_FAILURE
The evaluation has been abandoned due to failure to satisfy the termination condition. The result is returned as zero.
NE_TOTAL_PRECISION_LOSS
The evaluation has been abandoned due to total loss of precision. The result is returned as zero.
NW_SOME_PRECISION_LOSS
The evaluation has been completed but some precision has been lost.

7 Accuracy

All constants in the underlying functions 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 functions, 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

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

9 Further Comments

None.

10 Example

The example program reads values of the arguments x and ν from a file, evaluates the function and prints the results.

10.1 Program Text

Program Text (s18ecce.c)

10.2 Program Data

Program Data (s18ecce.d)

10.3 Program Results

Program Results (s18ecce.r)