s17af Method
関数リスト一覧   NagLibrary Namespaceへ  ライブラリイントロダクション  本ヘルプドキュメントのchm形式版

s17af returns the value of the Bessel function J1x.

Syntax

C#
public static double s17af(
	double x,
	out int ifail
)
Visual Basic (Declaration)
Public Shared Function s17af ( _
	x As Double, _
	<OutAttribute> ByRef ifail As Integer _
) As Double
Visual C++
public:
static double s17af(
	double x, 
	[OutAttribute] int% ifail
)
F#
static member s17af : 
        x:float * 
        ifail:int byref -> float 

Parameters

x
Type: System..::.Double
On entry: the argument x of the function.
ifail
Type: System..::.Int32 %
On exit: ifail=0 unless the method detects an error (see [Error Indicators and Warnings]).

Return Value

s17af returns the value of the Bessel function J1x.

Description

s17af evaluates an approximation to the Bessel function of the first kind J1x.
Note:  J1-x=-J1x, so the approximation need only consider x0.
The method is based on three Chebyshev expansions:
For 0<x8,
J1x=x8'r=0arTrt,   with ​t=2 x8 2-1.
For x>8,
J1x=2πx P1xcosx-3π4-Q1xsinx-3π4
where P1x='r=0brTrt,
and Q1x= 8x'r=0crTrt,
with t=2 8x 2-1.
For x near zero, J1x x2 . This approximation is used when x is sufficiently small for the result to be correct to machine precision.
For very large x, it becomes impossible to provide results with any reasonable accuracy (see [Accuracy]), hence the method fails. Such arguments contain insufficient information to determine the phase of oscillation of J1x; only the amplitude, 2πx , can be determined and this is returned on soft failure. The range for which this occurs is roughly related to machine precision; the method will fail if x1/machine precision (see the Library Constants section of the Introduction for details).

References

Error Indicators and Warnings

Errors or warnings detected by the method:
ifail=1
x is too large. On failure the method returns the amplitude of the J1 oscillation, 2πx .

Accuracy

Let δ be the relative error in the argument and E be the absolute error in the result. (Since J1x oscillates about zero, absolute error and not relative error is significant.)
However, if δ is of the same order as machine precision, then rounding errors could make E slightly larger than the above relation predicts.
For very large x, the above relation ceases to apply. In this region, J1x 2πx cosx- 3π4. The amplitude 2πx  can be calculated with reasonable accuracy for all x, but cosx- 3π4 cannot. If x- 3π4  is written as 2Nπ+θ where N is an integer and 0θ<2π, then cosx- 3π4 is determined by θ only. If xδ-1, θ cannot be determined with any accuracy at all. Thus if x is greater than, or of the order of, the reciprocal of machine precision, it is impossible to calculate the phase of J1x and the method must fail.

Further Comments

Example

See Also