s17dh returns the value of the Airy function Biz or its derivative Biz for complex z, with an option for exponential scaling.

Syntax

C#
public static void s17dh(
	string deriv,
	Complex z,
	string scal,
	out Complex bi,
	out int ifail
)
Visual Basic
Public Shared Sub s17dh ( _
	deriv As String, _
	z As Complex, _
	scal As String, _
	<OutAttribute> ByRef bi As Complex, _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void s17dh(
	String^ deriv, 
	Complex z, 
	String^ scal, 
	[OutAttribute] Complex% bi, 
	[OutAttribute] int% ifail
)
F#
static member s17dh : 
        deriv : string * 
        z : Complex * 
        scal : string * 
        bi : Complex byref * 
        ifail : int byref -> unit 

Parameters

deriv
Type: System..::..String
On entry: specifies whether the function or its derivative is required.
deriv="F"
Biz is returned.
deriv="D"
Biz is returned.
Constraint: deriv="F" or "D".
z
Type: NagLibrary..::..Complex
On entry: the argument z of the function.
scal
Type: System..::..String
On entry: the scaling option.
scal="U"
The result is returned unscaled.
scal="S"
The result is returned scaled by the factor eRe2zz/3.
Constraint: scal="U" or "S".
bi
Type: NagLibrary..::..Complex%
On exit: the required function or derivative value.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

s17dh returns a value for the Airy function Biz or its derivative Biz, where z is complex, -π<argzπ. Optionally, the value is scaled by the factor eRe2zz/3.
The method is derived from the method CBIRY in Amos (1986). It is based on the relations Biz=z3I-1/3w+I1/3w, and Biz=z3I-2/3w+I2/3w, where Iν is the modified Bessel function and w=2zz/3.
For very large z, argument reduction will cause total loss of accuracy, and so no computation is performed. For slightly smaller z, the computation is performed but results are accurate to less than half of machine precision. If Rez is too large, and the unscaled function is required, there is a risk of overflow and so no computation is performed. In all the above cases, a warning is given by the method.

References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Amos D E (1986) Algorithm 644: A portable package for Bessel functions of a complex argument and non-negative order ACM Trans. Math. Software 12 265–273

Error Indicators and Warnings

Errors or warnings detected by the method:
ifail=1
On entry,deriv"F" or "D".
orscal"U" or "S".
ifail=2
No computation has been performed due to the likelihood of overflow, because real(z) is too large – how large depends on the overflow threshold of the machine. This error exit can only occur when scal="U".
ifail=3
The computation has been performed, but the errors due to argument reduction in elementary functions make it likely that the result returned by s17dh is accurate to less than half of machine precision. This error exit may occur if absz is greater than a machine-dependent threshold value (given in the Users' Note for your implementation).
ifail=4
No computation has been performed because the errors due to argument reduction in elementary functions mean that all precision in the result returned by s17dh would be lost. This error exit may occur if absz is greater than a machine-dependent threshold value (given in the Users' Note for your implementation).
ifail=5
No result is returned because the algorithm termination condition has not been met. This may occur because the parameters supplied to s17dh would have caused overflow or underflow.
ifail=-9000
An error occured, see message report.

Accuracy

All constants in s17dh are given to approximately 18 digits of precision. Calling the number of digits of precision in the floating-point arithmetic being used t, 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 s17dh, the actual number of correct digits is limited, in general, by p-s, where smax1,log10z represents the number of digits lost due to the argument reduction. Thus the larger the value of z, the less the precision in the result.
Empirical tests with modest values of z, checking relations between Airy functions Aiz, Aiz, Biz and Biz, have shown errors limited to the least significant 3 – 4 digits of precision.

Parallelism and Performance

None.

Further Comments

Note that if the function is required to operate on a real argument only, then it may be much cheaper to call s17ah or s17ak.

Example

This example prints a caption and then proceeds to read sets of data from the input data stream. The first datum is a value for the parameter deriv, the second is a complex value for the argument, z, and the third is a character value to set the parameter scal. The program calls the method and prints the results. The process is repeated until the end of the input data stream is encountered.

Example program (C#): s17dhe.cs

Example program data: s17dhe.d

Example program results: s17dhe.r

See Also