0% found this document useful (0 votes)
13 views3 pages

S18eec cl06

gfhjg

Uploaded by

Khhg Agdds
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

S18eec cl06

gfhjg

Uploaded by

Khhg Agdds
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

s ± Approximations of Special Functions s18eec

NAG C Library Function Document


nag_bessel_i_nu (s18eec)

1 Purpose
nag_bessel_i_nu (s18eec) returns the value of the modi®ed Bessel function I=4 x† for real x > 0.

2 Speci®cation
double nag_bessel_i_nu (double x, Integer nu, NagError *fail)

3 Description
This routine evaluates an approximation to the modi®ed Bessel function of the ®rst kind 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.

4 Parameters
1: x ± double Input
On entry: the argument x of the function.
Constraints:
x > 0.0 when nu < 0,
x  0.0 when nu > 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 parameter (see the Essential Introduction).

5 Error Indicators and Warnings


NE_REAL_INT
On entry, x ˆ <value>, nu ˆ <value>.
Constraint: x > 0.0 when nu < 0.
On entry, x ˆ <value>, nu ˆ <value>.
Constraint: x  0.0 when nu > 0.

NE_INT
On entry, nu ˆ <value>.
Constraint: 1  abs(nu)  3.

[NP3491/6] s18eec.1
s18eec NAG C Library Manual

NE_OVERFLOW_LIKELY
The evaluation has been abandoned due to the likelihood of over¯ow. The result is returned as
zero.

NW_SOME_PRECISION_LOSS
The evaluation has been completed but some precision has been lost.

NE_TOTAL_PRECISION_LOSS
The evaluation has been abandoned due to total loss of precision. The result is returned as zero.

NE_TERMINATION_FAILURE
The evaluation has been abandoned due to failure to satisfy the termination condition. The result is
returned as zero.

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 consult NAG for assistance.

6 Further Comments
6.1 Accuracy
All constants in the underlying functions are speci®ed to approximately 18 digits of precision. If t denotes
the number of digits of precision in the ¯oating-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; jlog10 xj† 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.

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

7 See Also
None.

8 Example
The example program reads values of the arguments x and  from a ®le, evaluates the function and prints
the results.

8.1 Program Text


/* nag_bessel_i_nu (s18eec) Example Program.
*
* Copyright 2000 Numerical Algorithms Group.
*
* NAG C Library
*
* Mark 6, 2000.
*/

#include <stdio.h>
#include <nag.h>

s18eec.2 [NP3491/6]
s ± Approximations of Special Functions s18eec

#include <nag_stdlib.h>
#include <nags.h>

int main(void)
{
double x, y;
Integer exit_status=0;
NagError fail;
Integer nu;

INIT_FAIL(fail);
Vprintf("s18eec Example Program Results\n\n");

Vprintf(" x nu y\n");

/* Skip heading in data file */


Vscanf("%*[^\n]");
while (scanf("%lf %ld%*[^\n]", &x, &nu) != EOF)
{
y = s18eec(x, nu, &fail);
if (fail.code == NE_NOERROR)
Vprintf("%4.1f %6ld %12.4e\n", x, nu, y);
else
{
Vprintf("Error from s18eec.\n%s\n", fail.message);
exit_status = 1;
goto END;
}
}
END:
return exit_status;
} /* main */

8.2 Program Data


s18eec Example Program Data
3.9 -3
1.4 -2
8.2 -1
6.7 1
0.5 2
2.3 3 : Values of x and nu

8.3 Program Results


s18eec Example Program Results

x nu y
3.9 -3 9.5207e+00
1.4 -2 1.4504e+00
8.2 -1 5.1349e+02
6.7 1 1.2714e+02
0.5 2 5.8799e-01
2.3 3 2.3687e+00

[NP3491/6] s18eec.3 (last)

You might also like