CBIRY(3)

SYNOPSIS
SUBROUTINE CBIRY (Z, ID, KODE, BI, IERR)

NAME
cbiry - Compute the Airy function Bi(z) or its derivative dBi/dz for complex argument z. A scaling option is available to help avoid overflow.

LIBRARY
SLATEC

CATEGORY
C10D

TYPE
COMPLEX (CBIRY-C, ZBIRY-C)

KEYWORDS
AIRY FUNCTION, BESSEL FUNCTION OF ORDER ONE THIRD, BESSEL FUNCTION OF ORDER TWO THIRDS

AUTHOR
Amos, D. E., (SNL)

DESCRIPTION
On KODE=1, CBIRY computes the complex Airy function Bi(z) or its derivative dBi/dz on ID=0 or ID=1 respectively. On KODE=2, a scaling option exp(abs(Re(zeta)))*Bi(z) or exp(abs(Re(zeta)))*dBi/dz is provided to remove the exponential behavior in both the left and right half planes where zeta=(2/3)*z**(3/2). The Airy functions Bi(z) and dBi/dz are analytic in the whole z-plane, and the scaling option does not destroy this property. Input Z - Argument of type COMPLEX ID - Order of derivative, ID=0 or ID=1 KODE - A parameter to indicate the scaling option KODE=1 returns BI=Bi(z) on ID=0 BI=dBi/dz on ID=1 at z=Z =2 returns BI=exp(abs(Re(zeta)))*Bi(z) on ID=0 BI=exp(abs(Re(zeta)))*dBi/dz on ID=1 at z=Z where zeta=(2/3)*z**(3/2) Output BI - Result of type COMPLEX IERR - Error flag IERR=0 Normal return - COMPUTATION COMPLETED IERR=1 Input error - NO COMPUTATION IERR=2 Overflow - NO COMPUTATION (Re(Z) too large with KODE=1) IERR=3 Precision warning - COMPUTATION COMPLETED (Result has less than half precision) IERR=4 Precision error - NO COMPUTATION (Result has no precision) IERR=5 Algorithmic error - NO COMPUTATION (Termination condition not met) *Long Description: Bi(z) and dBi/dz are computed from I Bessel functions by Bi(z) = c*sqrt(z)*( I(-1/3,zeta) + I(1/3,zeta) ) dBi/dz = c* z *( I(-2/3,zeta) + I(2/3,zeta) ) c = 1/sqrt(3) zeta = (2/3)*z**(3/2) when abs(z)>1 and from power series when abs(z)<=1. In most complex variable computation, one must evaluate ele- mentary functions. When the magnitude of Z is large, losses of significance by argument reduction occur. Consequently, if the magnitude of ZETA=(2/3)*Z**(3/2) exceeds U1=SQRT(0.5/UR), then losses exceeding half precision are likely and an error flag IERR=3 is triggered where UR=R1MACH(4)=UNIT ROUNDOFF. Also, if the magnitude of ZETA is larger than U2=0.5/UR, then all significance is lost and IERR=4. In order to use the INT function, ZETA must be further restricted not to exceed U3=I1MACH(9)=LARGEST INTEGER. Thus, the magnitude of ZETA must be restricted by MIN(U2,U3). In IEEE arithmetic, U1,U2, and U3 are approximately 2.0E+3, 4.2E+6, 2.1E+9 in single precision and 4.7E+7, 2.3E+15, 2.1E+9 in double precision. This makes U2 limiting is single precision and U3 limiting in double precision. This means that the magnitude of Z cannot exceed approximately 3.4E+4 in single precision and 2.1E+6 in double precision. This also means that one can expect to retain, in the worst cases on 32-bit machines, no digits in single precision and only 6 digits in double precision. The approximate relative error in the magnitude of a complex Bessel function can be expressed as P*10**S where P=MAX(UNIT ROUNDOFF,1.0E-18) is the nominal precision and 10**S repre- sents the increase in error due to argument reduction in the elementary functions. Here, S=MAX(1,ABS(LOG10(ABS(Z))), ABS(LOG10(FNU))) approximately (i.e., S=MAX(1,ABS(EXPONENT OF ABS(Z),ABS(EXPONENT OF FNU)) ). However, the phase angle may have only absolute accuracy. This is most likely to occur when one component (in magnitude) is larger than the other by several orders of magnitude. If one component is 10**K larger than the other, then one can expect only MAX(ABS(LOG10(P))-K, 0) significant digits; or, stated another way, when K exceeds the exponent of P, no significant digits remain in the smaller component. However, the phase angle retains absolute accuracy because, in complex arithmetic with precision P, the smaller component will not (as a rule) decrease below P times the magnitude of the larger component. In these extreme cases, the principal phase angle is on the order of +P, -P, PI/2-P, or -PI/2+P.

REFERENCES
1. M. Abramowitz and I. A. Stegun, Handbook of Mathe- matical Functions, National Bureau of Standards Applied Mathematics Series 55, U. S. Department of Commerce, Tenth Printing (1972) or later. 2. D. E. Amos, Computation of Bessel Functions of Complex Argument and Large Order, Report SAND83-0643, Sandia National Laboratories, Albuquerque, NM, May 1983. 3. D. E. Amos, A Subroutine Package for Bessel Functions of a Complex Argument and Nonnegative Order, Report SAND85-1018, Sandia National Laboratory, Albuquerque, NM, May 1985. 4. D. E. Amos, A portable package for Bessel functions of a complex argument and nonnegative order, ACM Transactions on Mathematical Software, 12 (September 1986), pp. 265-273.

ROUTINES CALLED
CBINU, I1MACH, R1MACH

REVISION HISTORY (YYMMDD)
830501 DATE WRITTEN
890801 REVISION DATE from Version 3.2
910415 Prologue converted to Version 4.0 format. (BAB)
920128 Category corrected. (WRB)
920811 Prologue revised. (DWL)