dasyjy.f 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. *DECK DASYJY
  2. SUBROUTINE DASYJY (FUNJY, X, FNU, FLGJY, IN, Y, WK, IFLW)
  3. C***BEGIN PROLOGUE DASYJY
  4. C***SUBSIDIARY
  5. C***PURPOSE Subsidiary to DBESJ and DBESY
  6. C***LIBRARY SLATEC
  7. C***TYPE DOUBLE PRECISION (ASYJY-S, DASYJY-D)
  8. C***AUTHOR Amos, D. E., (SNLA)
  9. C***DESCRIPTION
  10. C
  11. C DASYJY computes Bessel functions J and Y
  12. C for arguments X.GT.0.0 and orders FNU .GE. 35.0
  13. C on FLGJY = 1 and FLGJY = -1 respectively
  14. C
  15. C INPUT
  16. C
  17. C FUNJY - External subroutine JAIRY or YAIRY
  18. C X - Argument, X.GT.0.0D0
  19. C FNU - Order of the first Bessel function
  20. C FLGJY - Selection flag
  21. C FLGJY = 1.0D0 gives the J function
  22. C FLGJY = -1.0D0 gives the Y function
  23. C IN - Number of functions desired, IN = 1 or 2
  24. C
  25. C OUTPUT
  26. C
  27. C Y - A vector whose first IN components contain the sequence
  28. C IFLW - A flag indicating underflow or overflow
  29. C return variables for BESJ only
  30. C WK(1) = 1 - (X/FNU)**2 = W**2
  31. C WK(2) = SQRT(ABS(WK(1)))
  32. C WK(3) = ABS(WK(2) - ATAN(WK(2))) or
  33. C ABS(LN((1 + WK(2))/(X/FNU)) - WK(2))
  34. C = ABS((2/3)*ZETA**(3/2))
  35. C WK(4) = FNU*WK(3)
  36. C WK(5) = (1.5*WK(3)*FNU)**(1/3) = SQRT(ZETA)*FNU**(1/3)
  37. C WK(6) = SIGN(1.,W**2)*WK(5)**2 = SIGN(1.,W**2)*ZETA*FNU**(2/3)
  38. C WK(7) = FNU**(1/3)
  39. C
  40. C Abstract **** A Double Precision Routine ****
  41. C DASYJY implements the uniform asymptotic expansion of
  42. C the J and Y Bessel functions for FNU.GE.35 and real
  43. C X.GT.0.0D0. The forms are identical except for a change
  44. C in sign of some of the terms. This change in sign is
  45. C accomplished by means of the flag FLGJY = 1 or -1. On
  46. C FLGJY = 1 the Airy functions AI(X) and DAI(X) are
  47. C supplied by the external function JAIRY, and on
  48. C FLGJY = -1 the Airy functions BI(X) and DBI(X) are
  49. C supplied by the external function YAIRY.
  50. C
  51. C***SEE ALSO DBESJ, DBESY
  52. C***ROUTINES CALLED D1MACH, I1MACH
  53. C***REVISION HISTORY (YYMMDD)
  54. C 750101 DATE WRITTEN
  55. C 890531 Changed all specific intrinsics to generic. (WRB)
  56. C 890911 Removed unnecessary intrinsics. (WRB)
  57. C 891004 Correction computation of ELIM. (WRB)
  58. C 891009 Removed unreferenced variable. (WRB)
  59. C 891214 Prologue converted to Version 4.0 format. (BAB)
  60. C 900328 Added TYPE section. (WRB)
  61. C 910408 Updated the AUTHOR section. (WRB)
  62. C***END PROLOGUE DASYJY
  63. INTEGER I, IFLW, IN, J, JN,JR,JU,K, KB,KLAST,KMAX,KP1, KS, KSP1,
  64. * KSTEMP, L, LR, LRP1, ISETA, ISETB
  65. INTEGER I1MACH
  66. DOUBLE PRECISION ABW2, AKM, ALFA, ALFA1, ALFA2, AP, AR, ASUM, AZ,
  67. * BETA, BETA1, BETA2, BETA3, BR, BSUM, C, CON1, CON2,
  68. * CON548,CR,CRZ32, DFI,ELIM, DR,FI, FLGJY, FN, FNU,
  69. * FN2, GAMA, PHI, RCZ, RDEN, RELB, RFN2, RTZ, RZDEN,
  70. * SA, SB, SUMA, SUMB, S1, TA, TAU, TB, TFN, TOL, TOLS, T2, UPOL,
  71. * WK, X, XX, Y, Z, Z32
  72. DOUBLE PRECISION D1MACH
  73. DIMENSION Y(*), WK(*), C(65)
  74. DIMENSION ALFA(26,4), BETA(26,5)
  75. DIMENSION ALFA1(26,2), ALFA2(26,2)
  76. DIMENSION BETA1(26,2), BETA2(26,2), BETA3(26,1)
  77. DIMENSION GAMA(26), KMAX(5), AR(8), BR(10), UPOL(10)
  78. DIMENSION CR(10), DR(10)
  79. EQUIVALENCE (ALFA(1,1),ALFA1(1,1))
  80. EQUIVALENCE (ALFA(1,3),ALFA2(1,1))
  81. EQUIVALENCE (BETA(1,1),BETA1(1,1))
  82. EQUIVALENCE (BETA(1,3),BETA2(1,1))
  83. EQUIVALENCE (BETA(1,5),BETA3(1,1))
  84. SAVE TOLS, CON1, CON2, CON548, AR, BR, C,
  85. 1 ALFA1, ALFA2, BETA1, BETA2, BETA3, GAMA
  86. DATA TOLS /-6.90775527898214D+00/
  87. DATA CON1,CON2,CON548/
  88. 1 6.66666666666667D-01, 3.33333333333333D-01, 1.04166666666667D-01/
  89. DATA AR(1), AR(2), AR(3), AR(4), AR(5), AR(6), AR(7),
  90. A AR(8) / 8.35503472222222D-02, 1.28226574556327D-01,
  91. 1 2.91849026464140D-01, 8.81627267443758D-01, 3.32140828186277D+00,
  92. 2 1.49957629868626D+01, 7.89230130115865D+01, 4.74451538868264D+02/
  93. DATA BR(1), BR(2), BR(3), BR(4), BR(5), BR(6), BR(7), BR(8),
  94. A BR(9), BR(10) /-1.45833333333333D-01,-9.87413194444444D-02,
  95. 1-1.43312053915895D-01,-3.17227202678414D-01,-9.42429147957120D-01,
  96. 2-3.51120304082635D+00,-1.57272636203680D+01,-8.22814390971859D+01,
  97. 3-4.92355370523671D+02,-3.31621856854797D+03/
  98. DATA C(1), C(2), C(3), C(4), C(5), C(6), C(7), C(8), C(9), C(10),
  99. 1 C(11), C(12), C(13), C(14), C(15), C(16), C(17), C(18),
  100. 2 C(19), C(20), C(21), C(22), C(23), C(24)/
  101. 3 -2.08333333333333D-01, 1.25000000000000D-01,
  102. 4 3.34201388888889D-01, -4.01041666666667D-01,
  103. 5 7.03125000000000D-02, -1.02581259645062D+00,
  104. 6 1.84646267361111D+00, -8.91210937500000D-01,
  105. 7 7.32421875000000D-02, 4.66958442342625D+00,
  106. 8 -1.12070026162230D+01, 8.78912353515625D+00,
  107. 9 -2.36408691406250D+00, 1.12152099609375D-01,
  108. A -2.82120725582002D+01, 8.46362176746007D+01,
  109. B -9.18182415432400D+01, 4.25349987453885D+01,
  110. C -7.36879435947963D+00, 2.27108001708984D-01,
  111. D 2.12570130039217D+02, -7.65252468141182D+02,
  112. E 1.05999045252800D+03, -6.99579627376133D+02/
  113. DATA C(25), C(26), C(27), C(28), C(29), C(30), C(31), C(32),
  114. 1 C(33), C(34), C(35), C(36), C(37), C(38), C(39), C(40),
  115. 2 C(41), C(42), C(43), C(44), C(45), C(46), C(47), C(48)/
  116. 3 2.18190511744212D+02, -2.64914304869516D+01,
  117. 4 5.72501420974731D-01, -1.91945766231841D+03,
  118. 5 8.06172218173731D+03, -1.35865500064341D+04,
  119. 6 1.16553933368645D+04, -5.30564697861340D+03,
  120. 7 1.20090291321635D+03, -1.08090919788395D+02,
  121. 8 1.72772750258446D+00, 2.02042913309661D+04,
  122. 9 -9.69805983886375D+04, 1.92547001232532D+05,
  123. A -2.03400177280416D+05, 1.22200464983017D+05,
  124. B -4.11926549688976D+04, 7.10951430248936D+03,
  125. C -4.93915304773088D+02, 6.07404200127348D+00,
  126. D -2.42919187900551D+05, 1.31176361466298D+06,
  127. E -2.99801591853811D+06, 3.76327129765640D+06/
  128. DATA C(49), C(50), C(51), C(52), C(53), C(54), C(55), C(56),
  129. 1 C(57), C(58), C(59), C(60), C(61), C(62), C(63), C(64),
  130. 2 C(65)/
  131. 3 -2.81356322658653D+06, 1.26836527332162D+06,
  132. 4 -3.31645172484564D+05, 4.52187689813627D+04,
  133. 5 -2.49983048181121D+03, 2.43805296995561D+01,
  134. 6 3.28446985307204D+06, -1.97068191184322D+07,
  135. 7 5.09526024926646D+07, -7.41051482115327D+07,
  136. 8 6.63445122747290D+07, -3.75671766607634D+07,
  137. 9 1.32887671664218D+07, -2.78561812808645D+06,
  138. A 3.08186404612662D+05, -1.38860897537170D+04,
  139. B 1.10017140269247D+02/
  140. DATA ALFA1(1,1), ALFA1(2,1), ALFA1(3,1), ALFA1(4,1), ALFA1(5,1),
  141. 1 ALFA1(6,1), ALFA1(7,1), ALFA1(8,1), ALFA1(9,1), ALFA1(10,1),
  142. 2 ALFA1(11,1),ALFA1(12,1),ALFA1(13,1),ALFA1(14,1),ALFA1(15,1),
  143. 3 ALFA1(16,1),ALFA1(17,1),ALFA1(18,1),ALFA1(19,1),ALFA1(20,1),
  144. 4 ALFA1(21,1),ALFA1(22,1),ALFA1(23,1),ALFA1(24,1),ALFA1(25,1),
  145. 5 ALFA1(26,1) /-4.44444444444444D-03,-9.22077922077922D-04,
  146. 6-8.84892884892885D-05, 1.65927687832450D-04, 2.46691372741793D-04,
  147. 7 2.65995589346255D-04, 2.61824297061501D-04, 2.48730437344656D-04,
  148. 8 2.32721040083232D-04, 2.16362485712365D-04, 2.00738858762752D-04,
  149. 9 1.86267636637545D-04, 1.73060775917876D-04, 1.61091705929016D-04,
  150. 1 1.50274774160908D-04, 1.40503497391270D-04, 1.31668816545923D-04,
  151. 2 1.23667445598253D-04, 1.16405271474738D-04, 1.09798298372713D-04,
  152. 3 1.03772410422993D-04, 9.82626078369363D-05, 9.32120517249503D-05,
  153. 4 8.85710852478712D-05, 8.42963105715700D-05, 8.03497548407791D-05/
  154. DATA ALFA1(1,2), ALFA1(2,2), ALFA1(3,2), ALFA1(4,2), ALFA1(5,2),
  155. 1 ALFA1(6,2), ALFA1(7,2), ALFA1(8,2), ALFA1(9,2), ALFA1(10,2),
  156. 2 ALFA1(11,2),ALFA1(12,2),ALFA1(13,2),ALFA1(14,2),ALFA1(15,2),
  157. 3 ALFA1(16,2),ALFA1(17,2),ALFA1(18,2),ALFA1(19,2),ALFA1(20,2),
  158. 4 ALFA1(21,2),ALFA1(22,2),ALFA1(23,2),ALFA1(24,2),ALFA1(25,2),
  159. 5 ALFA1(26,2) / 6.93735541354589D-04, 2.32241745182922D-04,
  160. 6-1.41986273556691D-05,-1.16444931672049D-04,-1.50803558053049D-04,
  161. 7-1.55121924918096D-04,-1.46809756646466D-04,-1.33815503867491D-04,
  162. 8-1.19744975684254D-04,-1.06184319207974D-04,-9.37699549891194D-05,
  163. 9-8.26923045588193D-05,-7.29374348155221D-05,-6.44042357721016D-05,
  164. 1-5.69611566009369D-05,-5.04731044303562D-05,-4.48134868008883D-05,
  165. 2-3.98688727717599D-05,-3.55400532972042D-05,-3.17414256609022D-05,
  166. 3-2.83996793904175D-05,-2.54522720634871D-05,-2.28459297164725D-05,
  167. 4-2.05352753106481D-05,-1.84816217627666D-05,-1.66519330021394D-05/
  168. DATA ALFA2(1,1), ALFA2(2,1), ALFA2(3,1), ALFA2(4,1), ALFA2(5,1),
  169. 1 ALFA2(6,1), ALFA2(7,1), ALFA2(8,1), ALFA2(9,1), ALFA2(10,1),
  170. 2 ALFA2(11,1),ALFA2(12,1),ALFA2(13,1),ALFA2(14,1),ALFA2(15,1),
  171. 3 ALFA2(16,1),ALFA2(17,1),ALFA2(18,1),ALFA2(19,1),ALFA2(20,1),
  172. 4 ALFA2(21,1),ALFA2(22,1),ALFA2(23,1),ALFA2(24,1),ALFA2(25,1),
  173. 5 ALFA2(26,1) /-3.54211971457744D-04,-1.56161263945159D-04,
  174. 6 3.04465503594936D-05, 1.30198655773243D-04, 1.67471106699712D-04,
  175. 7 1.70222587683593D-04, 1.56501427608595D-04, 1.36339170977445D-04,
  176. 8 1.14886692029825D-04, 9.45869093034688D-05, 7.64498419250898D-05,
  177. 9 6.07570334965197D-05, 4.74394299290509D-05, 3.62757512005344D-05,
  178. 1 2.69939714979225D-05, 1.93210938247939D-05, 1.30056674793963D-05,
  179. 2 7.82620866744497D-06, 3.59257485819352D-06, 1.44040049814252D-07,
  180. 3-2.65396769697939D-06,-4.91346867098486D-06,-6.72739296091248D-06,
  181. 4-8.17269379678658D-06,-9.31304715093561D-06,-1.02011418798016D-05/
  182. DATA ALFA2(1,2), ALFA2(2,2), ALFA2(3,2), ALFA2(4,2), ALFA2(5,2),
  183. 1 ALFA2(6,2), ALFA2(7,2), ALFA2(8,2), ALFA2(9,2), ALFA2(10,2),
  184. 2 ALFA2(11,2),ALFA2(12,2),ALFA2(13,2),ALFA2(14,2),ALFA2(15,2),
  185. 3 ALFA2(16,2),ALFA2(17,2),ALFA2(18,2),ALFA2(19,2),ALFA2(20,2),
  186. 4 ALFA2(21,2),ALFA2(22,2),ALFA2(23,2),ALFA2(24,2),ALFA2(25,2),
  187. 5 ALFA2(26,2) / 3.78194199201773D-04, 2.02471952761816D-04,
  188. 6-6.37938506318862D-05,-2.38598230603006D-04,-3.10916256027362D-04,
  189. 7-3.13680115247576D-04,-2.78950273791323D-04,-2.28564082619141D-04,
  190. 8-1.75245280340847D-04,-1.25544063060690D-04,-8.22982872820208D-05,
  191. 9-4.62860730588116D-05,-1.72334302366962D-05, 5.60690482304602D-06,
  192. 1 2.31395443148287D-05, 3.62642745856794D-05, 4.58006124490189D-05,
  193. 2 5.24595294959114D-05, 5.68396208545815D-05, 5.94349820393104D-05,
  194. 3 6.06478527578422D-05, 6.08023907788436D-05, 6.01577894539460D-05,
  195. 4 5.89199657344698D-05, 5.72515823777593D-05, 5.52804375585853D-05/
  196. DATA BETA1(1,1), BETA1(2,1), BETA1(3,1), BETA1(4,1), BETA1(5,1),
  197. 1 BETA1(6,1), BETA1(7,1), BETA1(8,1), BETA1(9,1), BETA1(10,1),
  198. 2 BETA1(11,1),BETA1(12,1),BETA1(13,1),BETA1(14,1),BETA1(15,1),
  199. 3 BETA1(16,1),BETA1(17,1),BETA1(18,1),BETA1(19,1),BETA1(20,1),
  200. 4 BETA1(21,1),BETA1(22,1),BETA1(23,1),BETA1(24,1),BETA1(25,1),
  201. 5 BETA1(26,1) / 1.79988721413553D-02, 5.59964911064388D-03,
  202. 6 2.88501402231133D-03, 1.80096606761054D-03, 1.24753110589199D-03,
  203. 7 9.22878876572938D-04, 7.14430421727287D-04, 5.71787281789705D-04,
  204. 8 4.69431007606482D-04, 3.93232835462917D-04, 3.34818889318298D-04,
  205. 9 2.88952148495752D-04, 2.52211615549573D-04, 2.22280580798883D-04,
  206. 1 1.97541838033063D-04, 1.76836855019718D-04, 1.59316899661821D-04,
  207. 2 1.44347930197334D-04, 1.31448068119965D-04, 1.20245444949303D-04,
  208. 3 1.10449144504599D-04, 1.01828770740567D-04, 9.41998224204238D-05,
  209. 4 8.74130545753834D-05, 8.13466262162801D-05, 7.59002269646219D-05/
  210. DATA BETA1(1,2), BETA1(2,2), BETA1(3,2), BETA1(4,2), BETA1(5,2),
  211. 1 BETA1(6,2), BETA1(7,2), BETA1(8,2), BETA1(9,2), BETA1(10,2),
  212. 2 BETA1(11,2),BETA1(12,2),BETA1(13,2),BETA1(14,2),BETA1(15,2),
  213. 3 BETA1(16,2),BETA1(17,2),BETA1(18,2),BETA1(19,2),BETA1(20,2),
  214. 4 BETA1(21,2),BETA1(22,2),BETA1(23,2),BETA1(24,2),BETA1(25,2),
  215. 5 BETA1(26,2) /-1.49282953213429D-03,-8.78204709546389D-04,
  216. 6-5.02916549572035D-04,-2.94822138512746D-04,-1.75463996970783D-04,
  217. 7-1.04008550460816D-04,-5.96141953046458D-05,-3.12038929076098D-05,
  218. 8-1.26089735980230D-05,-2.42892608575730D-07, 8.05996165414274D-06,
  219. 9 1.36507009262147D-05, 1.73964125472926D-05, 1.98672978842134D-05,
  220. 1 2.14463263790823D-05, 2.23954659232457D-05, 2.28967783814713D-05,
  221. 2 2.30785389811178D-05, 2.30321976080909D-05, 2.28236073720349D-05,
  222. 3 2.25005881105292D-05, 2.20981015361991D-05, 2.16418427448104D-05,
  223. 4 2.11507649256221D-05, 2.06388749782171D-05, 2.01165241997082D-05/
  224. DATA BETA2(1,1), BETA2(2,1), BETA2(3,1), BETA2(4,1), BETA2(5,1),
  225. 1 BETA2(6,1), BETA2(7,1), BETA2(8,1), BETA2(9,1), BETA2(10,1),
  226. 2 BETA2(11,1),BETA2(12,1),BETA2(13,1),BETA2(14,1),BETA2(15,1),
  227. 3 BETA2(16,1),BETA2(17,1),BETA2(18,1),BETA2(19,1),BETA2(20,1),
  228. 4 BETA2(21,1),BETA2(22,1),BETA2(23,1),BETA2(24,1),BETA2(25,1),
  229. 5 BETA2(26,1) / 5.52213076721293D-04, 4.47932581552385D-04,
  230. 6 2.79520653992021D-04, 1.52468156198447D-04, 6.93271105657044D-05,
  231. 7 1.76258683069991D-05,-1.35744996343269D-05,-3.17972413350427D-05,
  232. 8-4.18861861696693D-05,-4.69004889379141D-05,-4.87665447413787D-05,
  233. 9-4.87010031186735D-05,-4.74755620890087D-05,-4.55813058138628D-05,
  234. 1-4.33309644511266D-05,-4.09230193157750D-05,-3.84822638603221D-05,
  235. 2-3.60857167535411D-05,-3.37793306123367D-05,-3.15888560772110D-05,
  236. 3-2.95269561750807D-05,-2.75978914828336D-05,-2.58006174666884D-05,
  237. 4-2.41308356761280D-05,-2.25823509518346D-05,-2.11479656768913D-05/
  238. DATA BETA2(1,2), BETA2(2,2), BETA2(3,2), BETA2(4,2), BETA2(5,2),
  239. 1 BETA2(6,2), BETA2(7,2), BETA2(8,2), BETA2(9,2), BETA2(10,2),
  240. 2 BETA2(11,2),BETA2(12,2),BETA2(13,2),BETA2(14,2),BETA2(15,2),
  241. 3 BETA2(16,2),BETA2(17,2),BETA2(18,2),BETA2(19,2),BETA2(20,2),
  242. 4 BETA2(21,2),BETA2(22,2),BETA2(23,2),BETA2(24,2),BETA2(25,2),
  243. 5 BETA2(26,2) /-4.74617796559960D-04,-4.77864567147321D-04,
  244. 6-3.20390228067038D-04,-1.61105016119962D-04,-4.25778101285435D-05,
  245. 7 3.44571294294968D-05, 7.97092684075675D-05, 1.03138236708272D-04,
  246. 8 1.12466775262204D-04, 1.13103642108481D-04, 1.08651634848774D-04,
  247. 9 1.01437951597662D-04, 9.29298396593364D-05, 8.40293133016090D-05,
  248. 1 7.52727991349134D-05, 6.69632521975731D-05, 5.92564547323195D-05,
  249. 2 5.22169308826976D-05, 4.58539485165361D-05, 4.01445513891487D-05,
  250. 3 3.50481730031328D-05, 3.05157995034347D-05, 2.64956119950516D-05,
  251. 4 2.29363633690998D-05, 1.97893056664022D-05, 1.70091984636413D-05/
  252. DATA BETA3(1,1), BETA3(2,1), BETA3(3,1), BETA3(4,1), BETA3(5,1),
  253. 1 BETA3(6,1), BETA3(7,1), BETA3(8,1), BETA3(9,1), BETA3(10,1),
  254. 2 BETA3(11,1),BETA3(12,1),BETA3(13,1),BETA3(14,1),BETA3(15,1),
  255. 3 BETA3(16,1),BETA3(17,1),BETA3(18,1),BETA3(19,1),BETA3(20,1),
  256. 4 BETA3(21,1),BETA3(22,1),BETA3(23,1),BETA3(24,1),BETA3(25,1),
  257. 5 BETA3(26,1) / 7.36465810572578D-04, 8.72790805146194D-04,
  258. 6 6.22614862573135D-04, 2.85998154194304D-04, 3.84737672879366D-06,
  259. 7-1.87906003636972D-04,-2.97603646594555D-04,-3.45998126832656D-04,
  260. 8-3.53382470916038D-04,-3.35715635775049D-04,-3.04321124789040D-04,
  261. 9-2.66722723047613D-04,-2.27654214122820D-04,-1.89922611854562D-04,
  262. 1-1.55058918599094D-04,-1.23778240761874D-04,-9.62926147717644D-05,
  263. 2-7.25178327714425D-05,-5.22070028895634D-05,-3.50347750511901D-05,
  264. 3-2.06489761035552D-05,-8.70106096849767D-06, 1.13698686675100D-06,
  265. 4 9.16426474122779D-06, 1.56477785428873D-05, 2.08223629482467D-05/
  266. DATA GAMA(1), GAMA(2), GAMA(3), GAMA(4), GAMA(5),
  267. 1 GAMA(6), GAMA(7), GAMA(8), GAMA(9), GAMA(10),
  268. 2 GAMA(11), GAMA(12), GAMA(13), GAMA(14), GAMA(15),
  269. 3 GAMA(16), GAMA(17), GAMA(18), GAMA(19), GAMA(20),
  270. 4 GAMA(21), GAMA(22), GAMA(23), GAMA(24), GAMA(25),
  271. 5 GAMA(26) / 6.29960524947437D-01, 2.51984209978975D-01,
  272. 6 1.54790300415656D-01, 1.10713062416159D-01, 8.57309395527395D-02,
  273. 7 6.97161316958684D-02, 5.86085671893714D-02, 5.04698873536311D-02,
  274. 8 4.42600580689155D-02, 3.93720661543510D-02, 3.54283195924455D-02,
  275. 9 3.21818857502098D-02, 2.94646240791158D-02, 2.71581677112934D-02,
  276. 1 2.51768272973862D-02, 2.34570755306079D-02, 2.19508390134907D-02,
  277. 2 2.06210828235646D-02, 1.94388240897881D-02, 1.83810633800683D-02,
  278. 3 1.74293213231963D-02, 1.65685837786612D-02, 1.57865285987918D-02,
  279. 4 1.50729501494096D-02, 1.44193250839955D-02, 1.38184805735342D-02/
  280. C***FIRST EXECUTABLE STATEMENT DASYJY
  281. TA = D1MACH(3)
  282. TOL = MAX(TA,1.0D-15)
  283. TB = D1MACH(5)
  284. JU = I1MACH(15)
  285. IF(FLGJY.EQ.1.0D0) GO TO 6
  286. JR = I1MACH(14)
  287. ELIM = -2.303D0*TB*(JU+JR)
  288. GO TO 7
  289. 6 CONTINUE
  290. ELIM = -2.303D0*(TB*JU+3.0D0)
  291. 7 CONTINUE
  292. FN = FNU
  293. IFLW = 0
  294. DO 170 JN=1,IN
  295. XX = X/FN
  296. WK(1) = 1.0D0 - XX*XX
  297. ABW2 = ABS(WK(1))
  298. WK(2) = SQRT(ABW2)
  299. WK(7) = FN**CON2
  300. IF (ABW2.GT.0.27750D0) GO TO 80
  301. C
  302. C ASYMPTOTIC EXPANSION
  303. C CASES NEAR X=FN, ABS(1.-(X/FN)**2).LE.0.2775
  304. C COEFFICIENTS OF ASYMPTOTIC EXPANSION BY SERIES
  305. C
  306. C ZETA AND TRUNCATION FOR A(ZETA) AND B(ZETA) SERIES
  307. C
  308. C KMAX IS TRUNCATION INDEX FOR A(ZETA) AND B(ZETA) SERIES=MAX(2,SA)
  309. C
  310. SA = 0.0D0
  311. IF (ABW2.EQ.0.0D0) GO TO 10
  312. SA = TOLS/LOG(ABW2)
  313. 10 SB = SA
  314. DO 20 I=1,5
  315. AKM = MAX(SA,2.0D0)
  316. KMAX(I) = INT(AKM)
  317. SA = SA + SB
  318. 20 CONTINUE
  319. KB = KMAX(5)
  320. KLAST = KB - 1
  321. SA = GAMA(KB)
  322. DO 30 K=1,KLAST
  323. KB = KB - 1
  324. SA = SA*WK(1) + GAMA(KB)
  325. 30 CONTINUE
  326. Z = WK(1)*SA
  327. AZ = ABS(Z)
  328. RTZ = SQRT(AZ)
  329. WK(3) = CON1*AZ*RTZ
  330. WK(4) = WK(3)*FN
  331. WK(5) = RTZ*WK(7)
  332. WK(6) = -WK(5)*WK(5)
  333. IF(Z.LE.0.0D0) GO TO 35
  334. IF(WK(4).GT.ELIM) GO TO 75
  335. WK(6) = -WK(6)
  336. 35 CONTINUE
  337. PHI = SQRT(SQRT(SA+SA+SA+SA))
  338. C
  339. C B(ZETA) FOR S=0
  340. C
  341. KB = KMAX(5)
  342. KLAST = KB - 1
  343. SB = BETA(KB,1)
  344. DO 40 K=1,KLAST
  345. KB = KB - 1
  346. SB = SB*WK(1) + BETA(KB,1)
  347. 40 CONTINUE
  348. KSP1 = 1
  349. FN2 = FN*FN
  350. RFN2 = 1.0D0/FN2
  351. RDEN = 1.0D0
  352. ASUM = 1.0D0
  353. RELB = TOL*ABS(SB)
  354. BSUM = SB
  355. DO 60 KS=1,4
  356. KSP1 = KSP1 + 1
  357. RDEN = RDEN*RFN2
  358. C
  359. C A(ZETA) AND B(ZETA) FOR S=1,2,3,4
  360. C
  361. KSTEMP = 5 - KS
  362. KB = KMAX(KSTEMP)
  363. KLAST = KB - 1
  364. SA = ALFA(KB,KS)
  365. SB = BETA(KB,KSP1)
  366. DO 50 K=1,KLAST
  367. KB = KB - 1
  368. SA = SA*WK(1) + ALFA(KB,KS)
  369. SB = SB*WK(1) + BETA(KB,KSP1)
  370. 50 CONTINUE
  371. TA = SA*RDEN
  372. TB = SB*RDEN
  373. ASUM = ASUM + TA
  374. BSUM = BSUM + TB
  375. IF (ABS(TA).LE.TOL .AND. ABS(TB).LE.RELB) GO TO 70
  376. 60 CONTINUE
  377. 70 CONTINUE
  378. BSUM = BSUM/(FN*WK(7))
  379. GO TO 160
  380. C
  381. 75 CONTINUE
  382. IFLW = 1
  383. RETURN
  384. C
  385. 80 CONTINUE
  386. UPOL(1) = 1.0D0
  387. TAU = 1.0D0/WK(2)
  388. T2 = 1.0D0/WK(1)
  389. IF (WK(1).GE.0.0D0) GO TO 90
  390. C
  391. C CASES FOR (X/FN).GT.SQRT(1.2775)
  392. C
  393. WK(3) = ABS(WK(2)-ATAN(WK(2)))
  394. WK(4) = WK(3)*FN
  395. RCZ = -CON1/WK(4)
  396. Z32 = 1.5D0*WK(3)
  397. RTZ = Z32**CON2
  398. WK(5) = RTZ*WK(7)
  399. WK(6) = -WK(5)*WK(5)
  400. GO TO 100
  401. 90 CONTINUE
  402. C
  403. C CASES FOR (X/FN).LT.SQRT(0.7225)
  404. C
  405. WK(3) = ABS(LOG((1.0D0+WK(2))/XX)-WK(2))
  406. WK(4) = WK(3)*FN
  407. RCZ = CON1/WK(4)
  408. IF(WK(4).GT.ELIM) GO TO 75
  409. Z32 = 1.5D0*WK(3)
  410. RTZ = Z32**CON2
  411. WK(7) = FN**CON2
  412. WK(5) = RTZ*WK(7)
  413. WK(6) = WK(5)*WK(5)
  414. 100 CONTINUE
  415. PHI = SQRT((RTZ+RTZ)*TAU)
  416. TB = 1.0D0
  417. ASUM = 1.0D0
  418. TFN = TAU/FN
  419. RDEN=1.0D0/FN
  420. RFN2=RDEN*RDEN
  421. RDEN=1.0D0
  422. UPOL(2) = (C(1)*T2+C(2))*TFN
  423. CRZ32 = CON548*RCZ
  424. BSUM = UPOL(2) + CRZ32
  425. RELB = TOL*ABS(BSUM)
  426. AP = TFN
  427. KS = 0
  428. KP1 = 2
  429. RZDEN = RCZ
  430. L = 2
  431. ISETA=0
  432. ISETB=0
  433. DO 140 LR=2,8,2
  434. C
  435. C COMPUTE TWO U POLYNOMIALS FOR NEXT A(ZETA) AND B(ZETA)
  436. C
  437. LRP1 = LR + 1
  438. DO 120 K=LR,LRP1
  439. KS = KS + 1
  440. KP1 = KP1 + 1
  441. L = L + 1
  442. S1 = C(L)
  443. DO 110 J=2,KP1
  444. L = L + 1
  445. S1 = S1*T2 + C(L)
  446. 110 CONTINUE
  447. AP = AP*TFN
  448. UPOL(KP1) = AP*S1
  449. CR(KS) = BR(KS)*RZDEN
  450. RZDEN = RZDEN*RCZ
  451. DR(KS) = AR(KS)*RZDEN
  452. 120 CONTINUE
  453. SUMA = UPOL(LRP1)
  454. SUMB = UPOL(LR+2) + UPOL(LRP1)*CRZ32
  455. JU = LRP1
  456. DO 130 JR=1,LR
  457. JU = JU - 1
  458. SUMA = SUMA + CR(JR)*UPOL(JU)
  459. SUMB = SUMB + DR(JR)*UPOL(JU)
  460. 130 CONTINUE
  461. RDEN=RDEN*RFN2
  462. TB = -TB
  463. IF (WK(1).GT.0.0D0) TB = ABS(TB)
  464. IF(RDEN.LT.TOL) GO TO 131
  465. ASUM = ASUM + SUMA*TB
  466. BSUM = BSUM + SUMB*TB
  467. GO TO 140
  468. 131 IF(ISETA.EQ.1) GO TO 132
  469. IF(ABS(SUMA).LT.TOL) ISETA=1
  470. ASUM=ASUM+SUMA*TB
  471. 132 IF(ISETB.EQ.1) GO TO 133
  472. IF(ABS(SUMB).LT.RELB) ISETB=1
  473. BSUM=BSUM+SUMB*TB
  474. 133 IF(ISETA.EQ.1 .AND. ISETB.EQ.1) GO TO 150
  475. 140 CONTINUE
  476. 150 TB = WK(5)
  477. IF (WK(1).GT.0.0D0) TB = -TB
  478. BSUM = BSUM/TB
  479. C
  480. 160 CONTINUE
  481. CALL FUNJY(WK(6), WK(5), WK(4), FI, DFI)
  482. TA=1.0D0/TOL
  483. TB=D1MACH(1)*TA*1.0D+3
  484. IF(ABS(FI).GT.TB) GO TO 165
  485. FI=FI*TA
  486. DFI=DFI*TA
  487. PHI=PHI*TOL
  488. 165 CONTINUE
  489. Y(JN) = FLGJY*PHI*(FI*ASUM+DFI*BSUM)/WK(7)
  490. FN = FN - FLGJY
  491. 170 CONTINUE
  492. RETURN
  493. END