OpenLibm/slatec/dbesi0.f
Viral B. Shah c977aa998f Add Makefile.extras to build libopenlibm-extras.
Replace amos with slatec
2012-12-31 16:37:05 -05:00

78 lines
3.3 KiB
Fortran

*DECK DBESI0
DOUBLE PRECISION FUNCTION DBESI0 (X)
C***BEGIN PROLOGUE DBESI0
C***PURPOSE Compute the hyperbolic Bessel function of the first kind
C of order zero.
C***LIBRARY SLATEC (FNLIB)
C***CATEGORY C10B1
C***TYPE DOUBLE PRECISION (BESI0-S, DBESI0-D)
C***KEYWORDS FIRST KIND, FNLIB, HYPERBOLIC BESSEL FUNCTION,
C MODIFIED BESSEL FUNCTION, ORDER ZERO, SPECIAL FUNCTIONS
C***AUTHOR Fullerton, W., (LANL)
C***DESCRIPTION
C
C DBESI0(X) calculates the double precision modified (hyperbolic)
C Bessel function of the first kind of order zero and double
C precision argument X.
C
C Series for BI0 on the interval 0. to 9.00000E+00
C with weighted error 9.51E-34
C log weighted error 33.02
C significant figures required 33.31
C decimal places required 33.65
C
C***REFERENCES (NONE)
C***ROUTINES CALLED D1MACH, DBSI0E, DCSEVL, INITDS, XERMSG
C***REVISION HISTORY (YYMMDD)
C 770701 DATE WRITTEN
C 890531 Changed all specific intrinsics to generic. (WRB)
C 890531 REVISION DATE from Version 3.2
C 891214 Prologue converted to Version 4.0 format. (BAB)
C 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
C***END PROLOGUE DBESI0
DOUBLE PRECISION X, BI0CS(18), XMAX, XSML, Y, D1MACH,
1 DCSEVL, DBSI0E
LOGICAL FIRST
SAVE BI0CS, NTI0, XSML, XMAX, FIRST
DATA BI0CS( 1) / -.7660547252 8391449510 8189497624 3285 D-1 /
DATA BI0CS( 2) / +.1927337953 9938082699 5240875088 1196 D+1 /
DATA BI0CS( 3) / +.2282644586 9203013389 3702929233 0415 D+0 /
DATA BI0CS( 4) / +.1304891466 7072904280 7933421069 1888 D-1 /
DATA BI0CS( 5) / +.4344270900 8164874513 7868268102 6107 D-3 /
DATA BI0CS( 6) / +.9422657686 0019346639 2317174411 8766 D-5 /
DATA BI0CS( 7) / +.1434006289 5106910799 6209187817 9957 D-6 /
DATA BI0CS( 8) / +.1613849069 6617490699 1541971999 4611 D-8 /
DATA BI0CS( 9) / +.1396650044 5356696994 9509270814 2522 D-10 /
DATA BI0CS( 10) / +.9579451725 5054453446 2752317189 3333 D-13 /
DATA BI0CS( 11) / +.5333981859 8625021310 1510774400 0000 D-15 /
DATA BI0CS( 12) / +.2458716088 4374707746 9678591999 9999 D-17 /
DATA BI0CS( 13) / +.9535680890 2487700269 4434133333 3333 D-20 /
DATA BI0CS( 14) / +.3154382039 7214273367 8933333333 3333 D-22 /
DATA BI0CS( 15) / +.9004564101 0946374314 6666666666 6666 D-25 /
DATA BI0CS( 16) / +.2240647369 1236700160 0000000000 0000 D-27 /
DATA BI0CS( 17) / +.4903034603 2428373333 3333333333 3333 D-30 /
DATA BI0CS( 18) / +.9508172606 1226666666 6666666666 6666 D-33 /
DATA FIRST /.TRUE./
C***FIRST EXECUTABLE STATEMENT DBESI0
IF (FIRST) THEN
NTI0 = INITDS (BI0CS, 18, 0.1*REAL(D1MACH(3)))
XSML = SQRT(4.5D0*D1MACH(3))
XMAX = LOG (D1MACH(2))
ENDIF
FIRST = .FALSE.
C
Y = ABS(X)
IF (Y.GT.3.0D0) GO TO 20
C
DBESI0 = 1.0D0
IF (Y.GT.XSML) DBESI0 = 2.75D0 + DCSEVL (Y*Y/4.5D0-1.D0, BI0CS,
1 NTI0)
RETURN
C
20 IF (Y .GT. XMAX) CALL XERMSG ('SLATEC', 'DBESI0',
+ 'ABS(X) SO BIG I0 OVERFLOWS', 2, 2)
C
DBESI0 = EXP(Y) * DBSI0E(X)
C
RETURN
END