nag_complex_airy_bi (s17dhc) (PDF version)
s Chapter Contents
s Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_complex_airy_bi (s17dhc)

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

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

2  Specification

#include <nag.h>
#include <nags.h>
void  nag_complex_airy_bi (Nag_FunType deriv, Complex z, Nag_ScaleResType scal, Complex *bi, NagError *fail)

3  Description

nag_complex_airy_bi (s17dhc) 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 function is derived from the function 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 function.

4  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

5  Arguments

1:     deriv Nag_FunTypeInput
On entry: specifies whether the function or its derivative is required.
deriv=Nag_Function
Biz is returned.
deriv=Nag_Deriv
Biz is returned.
Constraint: deriv=Nag_Function or Nag_Deriv.
2:     z ComplexInput
On entry: the argument z of the function.
3:     scal Nag_ScaleResTypeInput
On entry: the scaling option.
scal=Nag_UnscaleRes
The result is returned unscaled.
scal=Nag_ScaleRes
The result is returned scaled by the factor eRe2zz/3.
Constraint: scal=Nag_UnscaleRes or Nag_ScaleRes.
4:     bi Complex *Output
On exit: the required function or derivative value.
5:     fail NagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.2.1.2 in the Essential Introduction for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
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.
An unexpected error has been triggered by this function. Please contact NAG.
See Section 3.6.6 in the Essential Introduction for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 3.6.5 in the Essential Introduction for further information.
NE_OVERFLOW_LIKELY
No computation because z.re=value is too large when scal=Nag_UnscaleRes.
NE_TERMINATION_FAILURE
No computation – algorithm termination condition not met.
NE_TOTAL_PRECISION_LOSS
No computation because z=value>value.
NW_SOME_PRECISION_LOSS
Results lack precision because z=value>value.

7  Accuracy

All constants in nag_complex_airy_bi (s17dhc) 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 nag_complex_airy_bi (s17dhc), the actual number of correct digits is limited, in general, by p-s, where s max1, 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.

8  Parallelism and Performance

Not applicable.

9  Further Comments

Note that if the function is required to operate on a real argument only, then it may be much cheaper to call nag_airy_bi (s17ahc) or nag_airy_bi_deriv (s17akc).

10  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 argument deriv, the second is a complex value for the argument, z, and the third is a character value used as a flag to set the argument scal. The program calls the function and prints the results. The process is repeated until the end of the input data stream is encountered.

10.1  Program Text

Program Text (s17dhce.c)

10.2  Program Data

Program Data (s17dhce.d)

10.3  Program Results

Program Results (s17dhce.r)


nag_complex_airy_bi (s17dhc) (PDF version)
s Chapter Contents
s Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015