SUBROUTINE DVI1 (M, X, F, WORK, IWORK, INFO) C***BEGIN PROLOGUE DVI1 C***PURPOSE Computes the hyperbolic Bessel function of the first kind C of order one (I1) for a vector of real arguments C***LIBRARY VFNLIB C***CATEGORY C10B1 C***TYPE DOUBLE PRECISION (VI1-S, DVI1-D) C***KEYWORDS BESSEL FUNCTION,FIRST KIND,HYPERBOLIC BESSEL FUNCTION, C MODIFIED BESSEL FUNCTION, ORDER ONE, VECTORIZED C***AUTHOR SAUNDERS, B. V., (NIST) C COMPUTING AND APPLIED MATHEMATICS LABORATORY C NATIONAL INSTITUTE OF STANDARDS AND TECHNOLOGY C GAITHERSBURG, MD 20899 C BOISVERT, R. F., (NIST) C COMPUTING AND APPLIED MATHEMATICS LABORATORY C NATIONAL INSTITUTE OF STANDARDS AND TECHNOLOGY C GAITHERSBURG, MD 20899 C***DESCRIPTION C C DVI1 computes the modified (hyperbolic) Bessel function of the C first kind of order one (I1) for real arguments using uniform C approximation by Chebyshev polynomials. C C C P A R A M E T E R S C C M (Input) Integer C The number of arguments at which the function is to be C evaluated. C C X (Input) Double precision array of length M C The arguments at which the function is to be evaluated are C stored in X(1) to X(M) in any order. C C F (Output) Double precision array of length M C F(i) contains the value of the function at X(i), i=1,..,M. C C WORK (Work) Double precision vector of length 7*M C C IWORK (Work) Integer vector of length M C C INFO (Output) Integer C Indicates status of computed result. The following table C lists possible values and their meanings. If OK=Yes then C all F(i) have been set, otherwise none have been set. C C INFO OK Description C ------------------------------------------------------------ C -1 Yes Warning: Some abs(X(i)) so small I1 underflows. C The corresponding F(i) are set to zero. C 0 Yes Successfull execution. C 1 No Error: M .LE. 0 C 2 No Error: Some abs(X(i)) so big I1 overflows. C The index of the first offending argument is C returned in IWORK(1). C C C ********************************************************************* C This routine is a modification of the function DBESI1 developed by C W. Fullerton of LANL. C ********************************************************************* C C***REFERENCES Ronald F. Boisvert and Bonita V. Saunders, Portable C Vectorized Software for Bessel Function Evaluation, C ACM Transactions on Mathematical Software 18 (1992), C pp 456-469. C***ROUTINES CALLED DWI1 C***REVISION HISTORY (YYMMDD) C 910226 DATE WRITTEN C 930203 Minor modifications to prologue. C***END PROLOGUE DVI1 C C ---------- C PARAMETERS C ---------- C INTEGER INFO, IWORK, M DOUBLE PRECISION F, X, WORK C DIMENSION X(M), F(M), WORK(7*M), IWORK(M) C C --------------- C LOCAL VARIABLES C --------------- C INTEGER IWB0, IWB1, IWB2, IWY, IWTC, IWYC, IWZC, JIN C C***FIRST EXECUTABLE STATEMENT DVI1 C C ... PARTITION WORK ARRAYS C IWY = 1 IWTC = IWY + M IWYC = IWTC + M IWZC = IWYC + M IWB0 = IWZC + M IWB1 = IWB0 + M IWB2 = IWB1 + M C Total = IWB2 + M C JIN = 1 C Total = JIN + M C C ... DWI1 DOES ALL THE WORK C CALL DWI1(M,X,F,WORK(IWY),WORK(IWTC),WORK(IWYC),WORK(IWZC), + IWORK(JIN),WORK(IWB0),WORK(IWB1),WORK(IWB2),INFO) C RETURN END SUBROUTINE DWI1(M, X, F, Y, TCMP, YCMP, ZCMP, INDX, B0, B1, B2, + INFO) C***BEGIN PROLOGUE DWI1 C***SUBSIDIARY C***PURPOSE Computes the hyperbolic Bessel function of the first kind C of order one (I1) for a vector of arguments C***LIBRARY VFNLIB C***AUTHOR SAUNDERS, B. V., (NIST) C COMPUTING AND APPLIED MATHEMATICS LABORATORY C NATIONAL INSTITUTE OF STANDARDS AND TECHNOLOGY C GAITHERSBURG, MD 20899 C BOISVERT, R. F., (NIST) C COMPUTING AND APPLIED MATHEMATICS LABORATORY C NATIONAL INSTITUTE OF STANDARDS AND TECHNOLOGY C GAITHERSBURG, MD 20899 C***ROUTINES CALLED IDWCS, D1MACH, DWNGT, DWGTHR, DWGTLE, DWGT, DWLE, C DWSCTR, DWCS C***REVISION HISTORY (YYMMDD) C 910226 DATE WRITTEN C***END PROLOGUE DWI1 C C ---------- C PARAMETERS C ---------- C INTEGER LAI1, LAI12, LBI1 PARAMETER ( LAI1=46, LAI12=69, LBI1=17 ) C INTEGER INFO, INDX, M DOUBLE PRECISION B0, B1, B2, F, X, Y, TCMP, YCMP, ZCMP C DIMENSION B0(M), B1(M), B2(M), F(M), INDX(M), X(M), Y(M), + TCMP(M), YCMP(M), ZCMP(M) C C --------------- C LOCAL VARIABLES C --------------- C INTEGER I, IDWCS, J, KEY, N, NTI1, NTAI1, NTAI12, NTOT DOUBLE PRECISION AI1CS, AI12CS, BI1CS, EPMACH, EPS, D1MACH, + XMAX, XMIN, XSML C DIMENSION AI1CS(LAI1), AI12CS(LAI12), BI1CS(LBI1) C SAVE AI1CS, AI12CS, BI1CS, N, NTAI1, NTAI12, NTI1, + XMAX, XMIN, XSML C C---------------------------------------------------------------------- C C Series for BI1 ON THE INTERVAL 0. to 9.00000D+00 C with weighted error 1.44E-32 C log weighted error 31.84 C significant figures required 31.45 C decimal places required 32.46 C DATA BI1 CS( 1) / -.1971713261 0998597316 1385032181 49 D-2 / DATA BI1 CS( 2) / +.4073488766 7546480608 1553936520 14 D+0 / DATA BI1 CS( 3) / +.3483899429 9959455866 2450377837 87 D-1 / DATA BI1 CS( 4) / +.1545394556 3001236038 5984010584 89 D-2 / DATA BI1 CS( 5) / +.4188852109 8377784129 4588320041 20 D-4 / DATA BI1 CS( 6) / +.7649026764 8362114741 9597039660 69 D-6 / DATA BI1 CS( 7) / +.1004249392 4741178689 1798080372 38 D-7 / DATA BI1 CS( 8) / +.9932207791 9238106481 3712980548 63 D-10 / DATA BI1 CS( 9) / +.7663801791 8447637275 2001716813 49 D-12 / DATA BI1 CS( 10) / +.4741418923 8167394980 3880919481 60 D-14 / DATA BI1 CS( 11) / +.2404114404 0745181799 8631720320 00 D-16 / DATA BI1 CS( 12) / +.1017150500 7093713649 1211007999 99 D-18 / DATA BI1 CS( 13) / +.3645093565 7866949458 4917333333 33 D-21 / DATA BI1 CS( 14) / +.1120574950 2562039344 8106666666 66 D-23 / DATA BI1 CS( 15) / +.2987544193 4468088832 0000000000 00 D-26 / DATA BI1 CS( 16) / +.6973231093 9194709333 3333333333 33 D-29 / DATA BI1 CS( 17) / +.1436794822 0620800000 0000000000 00 D-31 / C C------------------------------------------------------------------- C C Series for AI1 on the interval 1.25000D-01 to 3.33333D-01 C with weighted error 2.81E-32 C log weighted error 31.55 C significant figures required 29.93 C decimal places required 32.38 C DATA AI1 CS( 1) / -.2846744181 8814786741 0037246830 7 D-1 / DATA AI1 CS( 2) / -.1922953231 4432206510 4444877497 9 D-1 / DATA AI1 CS( 3) / -.6115185857 9437889822 5624991778 5 D-3 / DATA AI1 CS( 4) / -.2069971253 3502277088 8282377797 9 D-4 / DATA AI1 CS( 5) / +.8585619145 8107255655 3694467313 8 D-5 / DATA AI1 CS( 6) / +.1049498246 7115908625 1745399786 0 D-5 / DATA AI1 CS( 7) / -.2918338918 4479022020 9343232669 7 D-6 / DATA AI1 CS( 8) / -.1559378146 6317390001 6068096907 7 D-7 / DATA AI1 CS( 9) / +.1318012367 1449447055 2530287390 9 D-7 / DATA AI1 CS( 10) / -.1448423418 1830783176 3913446781 5 D-8 / DATA AI1 CS( 11) / -.2908512243 9931420948 2504099301 0 D-9 / DATA AI1 CS( 12) / +.1266388917 8753823873 1115969040 3 D-9 / DATA AI1 CS( 13) / -.1664947772 9192206706 2417839858 0 D-10 / DATA AI1 CS( 14) / -.1666653644 6094329760 9593715499 9 D-11 / DATA AI1 CS( 15) / +.1242602414 2907682652 3216847201 7 D-11 / DATA AI1 CS( 16) / -.2731549379 6724323972 5146142863 3 D-12 / DATA AI1 CS( 17) / +.2023947881 6458037807 0026268898 1 D-13 / DATA AI1 CS( 18) / +.7307950018 1168836361 9869812612 3 D-14 / DATA AI1 CS( 19) / -.3332905634 4046749438 1377861713 3 D-14 / DATA AI1 CS( 20) / +.7175346558 5129537435 4225466567 0 D-15 / DATA AI1 CS( 21) / -.6982530324 7962563558 5062922365 6 D-16 / DATA AI1 CS( 22) / -.1299944201 5627607600 6044608058 7 D-16 / DATA AI1 CS( 23) / +.8120942864 2427988920 5467834286 0 D-17 / DATA AI1 CS( 24) / -.2194016207 4107368981 5626664378 3 D-17 / DATA AI1 CS( 25) / +.3630516170 0296548482 7986093233 4 D-18 / DATA AI1 CS( 26) / -.1695139772 4391041663 0686679039 9 D-19 / DATA AI1 CS( 27) / -.1288184829 8979078071 1688253822 2 D-19 / DATA AI1 CS( 28) / +.5694428604 9670527801 0999107310 9 D-20 / DATA AI1 CS( 29) / -.1459597009 0904800565 4550990028 7 D-20 / DATA AI1 CS( 30) / +.2514546010 6757173140 8469133448 5 D-21 / DATA AI1 CS( 31) / -.1844758883 1391248181 6040002901 3 D-22 / DATA AI1 CS( 32) / -.6339760596 2279486419 2860979199 9 D-23 / DATA AI1 CS( 33) / +.3461441102 0310111111 0814662656 0 D-23 / DATA AI1 CS( 34) / -.1017062335 3713935475 9654102357 3 D-23 / DATA AI1 CS( 35) / +.2149877147 0904314459 6250077866 6 D-24 / DATA AI1 CS( 36) / -.3045252425 2386764017 4620617386 6 D-25 / DATA AI1 CS( 37) / +.5238082144 7212859821 7763498666 6 D-27 / DATA AI1 CS( 38) / +.1443583107 0893824464 1678950399 9 D-26 / DATA AI1 CS( 39) / -.6121302074 8900427332 0067071999 9 D-27 / DATA AI1 CS( 40) / +.1700011117 4678184183 4918980266 6 D-27 / DATA AI1 CS( 41) / -.3596589107 9842441585 3521578666 6 D-28 / DATA AI1 CS( 42) / +.5448178578 9484185766 5051306666 6 D-29 / DATA AI1 CS( 43) / -.2731831789 6890849891 6256426666 6 D-30 / DATA AI1 CS( 44) / -.1858905021 7086007157 7190399999 9 D-30 / DATA AI1 CS( 45) / +.9212682974 5139334411 2776533333 3 D-31 / DATA AI1 CS( 46) / -.2813835155 6535611063 7083306666 6 D-31 / C C------------------------------------------------------------------- C C Series for AI12 on the interval 0. to 1.25000D-01 C with weighted error 1.83E-32 C log weighted error 31.74 C significant figures required 29.97 C decimal places required 32.66 C DATA AI12CS( 1) / +.2857623501 8280120474 4984594846 9 D-1 / DATA AI12CS( 2) / -.9761097491 3614684077 6516445730 2 D-2 / DATA AI12CS( 3) / -.1105889387 6262371629 1256921277 5 D-3 / DATA AI12CS( 4) / -.3882564808 8776903934 5654477627 4 D-5 / DATA AI12CS( 5) / -.2512236237 8702089252 9452002212 1 D-6 / DATA AI12CS( 6) / -.2631468846 8895195068 3705236523 2 D-7 / DATA AI12CS( 7) / -.3835380385 9642370220 4500678796 8 D-8 / DATA AI12CS( 8) / -.5589743462 1965838068 6811252222 9 D-9 / DATA AI12CS( 9) / -.1897495812 3505412344 9892503323 8 D-10 / DATA AI12CS( 10) / +.3252603583 0154882385 5508067994 9 D-10 / DATA AI12CS( 11) / +.1412580743 6613781331 6336633284 6 D-10 / DATA AI12CS( 12) / +.2035628544 1470895072 2452613684 0 D-11 / DATA AI12CS( 13) / -.7198551776 2459085120 9258989044 6 D-12 / DATA AI12CS( 14) / -.4083551111 0921973182 2849963969 1 D-12 / DATA AI12CS( 15) / -.2101541842 7726643130 1984572746 2 D-13 / DATA AI12CS( 16) / +.4272440016 7119513542 9778833699 7 D-13 / DATA AI12CS( 17) / +.1042027698 4128802764 1741449994 8 D-13 / DATA AI12CS( 18) / -.3814403072 4370078047 6707253539 6 D-14 / DATA AI12CS( 19) / -.1880354775 5107824485 1273453396 3 D-14 / DATA AI12CS( 20) / +.3308202310 9209282827 3190335240 5 D-15 / DATA AI12CS( 21) / +.2962628997 6459501390 6854654205 2 D-15 / DATA AI12CS( 22) / -.3209525921 9934239587 7837353288 7 D-16 / DATA AI12CS( 23) / -.4650305368 4893583255 7128281897 9 D-16 / DATA AI12CS( 24) / +.4414348323 0717079499 4611375964 1 D-17 / DATA AI12CS( 25) / +.7517296310 8421048054 2545808029 5 D-17 / DATA AI12CS( 26) / -.9314178867 3268833756 8484784515 7 D-18 / DATA AI12CS( 27) / -.1242193275 1948909561 1678448869 7 D-17 / DATA AI12CS( 28) / +.2414276719 4548484690 0515390217 6 D-18 / DATA AI12CS( 29) / +.2026944384 0532851789 7192286069 2 D-18 / DATA AI12CS( 30) / -.6394267188 2690977870 4391988681 1 D-19 / DATA AI12CS( 31) / -.3049812452 3730958960 8488450357 1 D-19 / DATA AI12CS( 32) / +.1612841851 6514802251 3462230769 1 D-19 / DATA AI12CS( 33) / +.3560913964 3099250545 1027090462 0 D-20 / DATA AI12CS( 34) / -.3752017947 9364390796 6682800324 6 D-20 / DATA AI12CS( 35) / -.5787037427 0747993459 5198231074 1 D-22 / DATA AI12CS( 36) / +.7759997511 6481619619 8236963209 2 D-21 / DATA AI12CS( 37) / -.1452790897 2022333940 6445987408 5 D-21 / DATA AI12CS( 38) / -.1318225286 7390367021 2192275337 4 D-21 / DATA AI12CS( 39) / +.6116654862 9030707018 7999133171 7 D-22 / DATA AI12CS( 40) / +.1376279762 4271264277 3024338363 4 D-22 / DATA AI12CS( 41) / -.1690837689 9593478849 1983938230 6 D-22 / DATA AI12CS( 42) / +.1430596088 5954331539 8720108538 5 D-23 / DATA AI12CS( 43) / +.3409557828 0905940204 0536772990 2 D-23 / DATA AI12CS( 44) / -.1309457666 2707602278 4573872642 4 D-23 / DATA AI12CS( 45) / -.3940706411 2402574360 9352141755 7 D-24 / DATA AI12CS( 46) / +.4277137426 9808765808 0616679735 2 D-24 / DATA AI12CS( 47) / -.4424634830 9826068819 0028312302 9 D-25 / DATA AI12CS( 48) / -.8734113196 2307149721 1530978874 7 D-25 / DATA AI12CS( 49) / +.4045401335 6835333921 4340414242 8 D-25 / DATA AI12CS( 50) / +.7067100658 0946894656 5160771780 6 D-26 / DATA AI12CS( 51) / -.1249463344 5651052230 0286451860 5 D-25 / DATA AI12CS( 52) / +.2867392244 4034370329 7948339142 6 D-26 / DATA AI12CS( 53) / +.2044292892 5042926702 8177957421 0 D-26 / DATA AI12CS( 54) / -.1518636633 8204625683 7134680291 1 D-26 / DATA AI12CS( 55) / +.8110181098 1875758861 3227910703 7 D-28 / DATA AI12CS( 56) / +.3580379354 7735860911 2717370327 0 D-27 / DATA AI12CS( 57) / -.1692929018 9279025095 9305717544 8 D-27 / DATA AI12CS( 58) / -.2222902499 7024276390 6775852777 4 D-28 / DATA AI12CS( 59) / +.5424535127 1459696550 4860040112 8 D-28 / DATA AI12CS( 60) / -.1787068401 5780186887 6491299330 4 D-28 / DATA AI12CS( 61) / -.6565479068 7228149388 2392943788 0 D-29 / DATA AI12CS( 62) / +.7807013165 0611452809 2206770683 9 D-29 / DATA AI12CS( 63) / -.1816595260 6689797173 7933315222 1 D-29 / DATA AI12CS( 64) / -.1287704952 6600848203 7687559895 9 D-29 / DATA AI12CS( 65) / +.1114548172 9881645474 1370927369 4 D-29 / DATA AI12CS( 66) / -.1808343145 0393369391 5936887668 7 D-30 / DATA AI12CS( 67) / -.2231677718 2037719522 3244822893 9 D-30 / DATA AI12CS( 68) / +.1619029596 0803415106 1790980361 4 D-30 / DATA AI12CS( 69) / -.1834079908 8049414139 0130843921 0 D-31 / C C------------------------------------------------------------------- C DATA NTI1 / 0 / C C***FIRST EXECUTABLE STATEMENT DWI1 C IF (M .LE. 0) GO TO 910 C IF (NTI1.EQ.0) THEN EPMACH = D1MACH(3) EPS = 0.10D0*EPMACH NTI1 = IDWCS (BI1CS, LBI1, EPS) NTAI1 = IDWCS (AI1CS, LAI1, EPS) NTAI12 = IDWCS (AI12CS, LAI12, EPS) XMIN = 2.0D0*D1MACH(1) XSML = SQRT(8.0D0*EPMACH) XMAX = LOG(D1MACH(2)) ENDIF C NTOT = 0 C DO 10 I=1,M Y(I) = ABS(X(I)) 10 CONTINUE C CALL DWNGT(M,Y,XMAX,KEY) IF (KEY .NE. 0) GO TO 920 C C --------------------------- C CASE Y=0 OR Y TOO SMALL C --------------------------- C C NOTE -- I0 UNDERFLOWS FOR X .LE. XMIN C DO 15 I=1,M F(I) = 0.0D0 15 CONTINUE C C ---------------------------- C CASE XMIN .LT. Y .LE. XSML C ---------------------------- C CALL DWGTLE(M,Y,XMIN,XSML,N,INDX) IF (N .GT. 0) THEN NTOT = NTOT + N CALL DWGTHR(N,Y,INDX,YCMP) DO 20 J=1,N ZCMP(J) = 0.50D0*YCMP(J) 20 CONTINUE CALL DWSCTR(N,ZCMP,INDX,F) ENDIF C C --------------------------- C CASE XSML .LT. Y .LE. 3.0 C --------------------------- C CALL DWGTLE(M,Y,XSML,3.0D0,N,INDX) IF (N .GT. 0) THEN NTOT = NTOT + N CALL DWGTHR(N,Y,INDX,YCMP) DO 30 J=1,N TCMP(J) = YCMP(J)**2/4.50D0 - 1.0D0 30 CONTINUE CALL DWCS(N,TCMP,BI1CS,NTI1,ZCMP,B0,B1,B2) DO 40 J=1,N ZCMP(J) = YCMP(J)*(0.8750D0 + ZCMP(J)) 40 CONTINUE CALL DWSCTR(N,ZCMP,INDX,F) ENDIF C C ------------------------- C CASE 3.0 .LT. Y .LE. 8.0 C ------------------------- C CALL DWGTLE(M,Y,3.0D0,8.0D0,N,INDX) IF (N .GT. 0) THEN NTOT = NTOT + N CALL DWGTHR(N,Y,INDX,YCMP) DO 70 J=1,N TCMP(J) = (48.0D0/YCMP(J) - 11.0D0)/5.0D0 70 CONTINUE CALL DWCS(N,TCMP,AI1CS,NTAI1,ZCMP,B0,B1,B2) DO 80 J=1,N ZCMP(J) = EXP(YCMP(J))*(0.3750D0 + ZCMP(J))/SQRT(YCMP(J)) 80 CONTINUE CALL DWSCTR(N,ZCMP,INDX,F) ENDIF C C ---------------- C CASE 8.0 .LT. Y C ---------------- C CALL DWGT(M,Y,8.0D0,N,INDX) IF (N .GT. 0) THEN NTOT = NTOT + N CALL DWGTHR(N,Y,INDX,YCMP) DO 100 J=1,N TCMP(J) = 16.0D0/YCMP(J) - 1.0D0 100 CONTINUE CALL DWCS(N,TCMP,AI12CS,NTAI12,ZCMP,B0,B1,B2) DO 110 J=1,N ZCMP(J) = EXP(YCMP(J))*(0.3750D0 + ZCMP(J))/SQRT(YCMP(J)) 110 CONTINUE CALL DWSCTR(N,ZCMP,INDX,F) ENDIF C C ------------------------------------------- C REVERSE SIGN FOR NEGATIVE X (RESULT IS ODD) C ------------------------------------------- C DO 200 I=1,M IF (X(I) .LT. 0.0D0) F(I) = -F(I) 200 CONTINUE C C ----- C EXITS C ----- C C ... NORMAL C INFO = 0 IF (NTOT .NE. M) INFO = -1 GO TO 999 C C ... M .LE. 0 C 910 CONTINUE INFO = 1 GO TO 999 C C ... ABS(X) SO LARGE I1 OVERFLOWS C 920 CONTINUE INFO = 2 INDX(1) = KEY GO TO 999 C 999 CONTINUE RETURN END