dbsi0e.cpp 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. /* dbsi0e.f -- translated by f2c (version 20100827).
  2. This file no longer depends on f2c.
  3. */
  4. #include "slatec-internal.hpp"
  5. /* Table of constant values */
  6. static integer const c__3 = 3;
  7. static integer const c__18 = 18;
  8. static integer const c__46 = 46;
  9. static integer const c__69 = 69;
  10. /* Initialized data */
  11. static double const bi0cs[18] = { -.07660547252839144951081894976243285,
  12. 1.927337953993808269952408750881196,
  13. .2282644586920301338937029292330415,
  14. .01304891466707290428079334210691888,
  15. 4.344270900816487451378682681026107e-4,
  16. 9.422657686001934663923171744118766e-6,
  17. 1.434006289510691079962091878179957e-7,
  18. 1.613849069661749069915419719994611e-9,
  19. 1.396650044535669699495092708142522e-11,
  20. 9.579451725505445344627523171893333e-14,
  21. 5.333981859862502131015107744e-16,
  22. 2.458716088437470774696785919999999e-18,
  23. 9.535680890248770026944341333333333e-21,
  24. 3.154382039721427336789333333333333e-23,
  25. 9.004564101094637431466666666666666e-26,2.240647369123670016e-28,
  26. 4.903034603242837333333333333333333e-31,
  27. 9.508172606122666666666666666666666e-34 };
  28. static double const ai0cs[46] = { .07575994494023795942729872037438,
  29. .007591380810823345507292978733204,
  30. 4.153131338923750501863197491382e-4,
  31. 1.07007646343907307358242970217e-5,
  32. -7.90117997921289466075031948573e-6,
  33. -7.826143501438752269788989806909e-7,
  34. 2.783849942948870806381185389857e-7,
  35. 8.252472600612027191966829133198e-9,
  36. -1.204463945520199179054960891103e-8,
  37. 1.559648598506076443612287527928e-9,
  38. 2.292556367103316543477254802857e-10,
  39. -1.191622884279064603677774234478e-10,
  40. 1.757854916032409830218331247743e-11,
  41. 1.128224463218900517144411356824e-12,
  42. -1.146848625927298877729633876982e-12,
  43. 2.715592054803662872643651921606e-13,
  44. -2.415874666562687838442475720281e-14,
  45. -6.084469888255125064606099639224e-15,
  46. 3.145705077175477293708360267303e-15,
  47. -7.172212924871187717962175059176e-16,
  48. 7.874493403454103396083909603327e-17,
  49. 1.004802753009462402345244571839e-17,
  50. -7.56689536535053485342843588881e-18,
  51. 2.150380106876119887812051287845e-18,
  52. -3.754858341830874429151584452608e-19,
  53. 2.354065842226992576900757105322e-20,
  54. 1.11466761204792853022637335511e-20,
  55. -5.398891884396990378696779322709e-21,
  56. 1.439598792240752677042858404522e-21,
  57. -2.591916360111093406460818401962e-22,
  58. 2.23813318399858390743409229824e-23,
  59. 5.250672575364771172772216831999e-24,
  60. -3.249904138533230784173432285866e-24,
  61. 9.9242141032050379278572847104e-25,
  62. -2.164992254244669523146554299733e-25,
  63. 3.233609471943594083973332991999e-26,
  64. -1.184620207396742489824733866666e-27,
  65. -1.281671853950498650548338687999e-27,
  66. 5.827015182279390511605568853333e-28,
  67. -1.668222326026109719364501503999e-28,
  68. 3.6253095105415699757006848e-29,
  69. -5.733627999055713589945958399999e-30,
  70. 3.736796722063098229642581333333e-31,
  71. 1.602073983156851963365512533333e-31,
  72. -8.700424864057229884522495999999e-32,
  73. 2.741320937937481145603413333333e-32 };
  74. static double const ai02cs[69] = { .0544904110141088316078960962268,
  75. .003369116478255694089897856629799,
  76. 6.889758346916823984262639143011e-5,
  77. 2.891370520834756482966924023232e-6,
  78. 2.048918589469063741827605340931e-7,
  79. 2.266668990498178064593277431361e-8,
  80. 3.396232025708386345150843969523e-9,
  81. 4.940602388224969589104824497835e-10,
  82. 1.188914710784643834240845251963e-11,
  83. -3.149916527963241364538648629619e-11,
  84. -1.321581184044771311875407399267e-11,
  85. -1.794178531506806117779435740269e-12,
  86. 7.180124451383666233671064293469e-13,
  87. 3.852778382742142701140898017776e-13,
  88. 1.540086217521409826913258233397e-14,
  89. -4.150569347287222086626899720156e-14,
  90. -9.554846698828307648702144943125e-15,
  91. 3.811680669352622420746055355118e-15,
  92. 1.772560133056526383604932666758e-15,
  93. -3.425485619677219134619247903282e-16,
  94. -2.827623980516583484942055937594e-16,
  95. 3.461222867697461093097062508134e-17,
  96. 4.465621420296759999010420542843e-17,
  97. -4.830504485944182071255254037954e-18,
  98. -7.233180487874753954562272409245e-18,
  99. 9.92147541217369859888046093981e-19,
  100. 1.193650890845982085504399499242e-18,
  101. -2.488709837150807235720544916602e-19,
  102. -1.938426454160905928984697811326e-19,
  103. 6.444656697373443868783019493949e-20,
  104. 2.886051596289224326481713830734e-20,
  105. -1.601954907174971807061671562007e-20,
  106. -3.270815010592314720891935674859e-21,
  107. 3.686932283826409181146007239393e-21,
  108. 1.268297648030950153013595297109e-23,
  109. -7.549825019377273907696366644101e-22,
  110. 1.502133571377835349637127890534e-22,
  111. 1.265195883509648534932087992483e-22,
  112. -6.100998370083680708629408916002e-23,
  113. -1.268809629260128264368720959242e-23,
  114. 1.661016099890741457840384874905e-23,
  115. -1.585194335765885579379705048814e-24,
  116. -3.302645405968217800953817667556e-24,
  117. 1.313580902839239781740396231174e-24,
  118. 3.689040246671156793314256372804e-25,
  119. -4.210141910461689149219782472499e-25,
  120. 4.79195459108286578063171401373e-26,
  121. 8.459470390221821795299717074124e-26,
  122. -4.03980094087283249314607937181e-26,
  123. -6.434714653650431347301008504695e-27,
  124. 1.225743398875665990344647369905e-26,
  125. -2.934391316025708923198798211754e-27,
  126. -1.961311309194982926203712057289e-27,
  127. 1.503520374822193424162299003098e-27,
  128. -9.588720515744826552033863882069e-29,
  129. -3.483339380817045486394411085114e-28,
  130. 1.690903610263043673062449607256e-28,
  131. 1.982866538735603043894001157188e-29,
  132. -5.317498081491816214575830025284e-29,
  133. 1.803306629888392946235014503901e-29,
  134. 6.213093341454893175884053112422e-30,
  135. -7.69218929277216186320072806673e-30,
  136. 1.858252826111702542625560165963e-30,
  137. 1.237585142281395724899271545541e-30,
  138. -1.102259120409223803217794787792e-30,
  139. 1.886287118039704490077874479431e-31,
  140. 2.16019687224365891314903141406e-31,
  141. -1.605454124919743200584465949655e-31,
  142. 1.965352984594290603938848073318e-32 };
  143. static float const eta = (float) d1mach_(3) * (float).1;
  144. static integer const nti0 = initds_(bi0cs, &c__18, &eta);
  145. static integer const ntai0 = initds_(ai0cs, &c__46, &eta);
  146. static integer const ntai02 = initds_(ai02cs, &c__69, &eta);
  147. static double const xsml = sqrt(d1mach_(3) * 4.5);
  148. double dbsi0e_(double const *x)
  149. {
  150. /* System generated locals */
  151. double ret_val, d__1;
  152. /* Local variables */
  153. double y;
  154. /* ***BEGIN PROLOGUE DBSI0E */
  155. /* ***PURPOSE Compute the exponentially scaled modified (hyperbolic) */
  156. /* Bessel function of the first kind of order zero. */
  157. /* ***LIBRARY SLATEC (FNLIB) */
  158. /* ***CATEGORY C10B1 */
  159. /* ***TYPE DOUBLE PRECISION (BESI0E-S, DBSI0E-D) */
  160. /* ***KEYWORDS EXPONENTIALLY SCALED, FIRST KIND, FNLIB, */
  161. /* HYPERBOLIC BESSEL FUNCTION, MODIFIED BESSEL FUNCTION, */
  162. /* ORDER ZERO, SPECIAL FUNCTIONS */
  163. /* ***AUTHOR Fullerton, W., (LANL) */
  164. /* ***DESCRIPTION */
  165. /* DBSI0E(X) calculates the double precision exponentially scaled */
  166. /* modified (hyperbolic) Bessel function of the first kind of order */
  167. /* zero for double precision argument X. The result is the Bessel */
  168. /* function I0(X) multiplied by EXP(-ABS(X)). */
  169. /* Series for BI0 on the interval 0. to 9.00000E+00 */
  170. /* with weighted error 9.51E-34 */
  171. /* log weighted error 33.02 */
  172. /* significant figures required 33.31 */
  173. /* decimal places required 33.65 */
  174. /* Series for AI0 on the interval 1.25000E-01 to 3.33333E-01 */
  175. /* with weighted error 2.74E-32 */
  176. /* log weighted error 31.56 */
  177. /* significant figures required 30.15 */
  178. /* decimal places required 32.39 */
  179. /* Series for AI02 on the interval 0. to 1.25000E-01 */
  180. /* with weighted error 1.97E-32 */
  181. /* log weighted error 31.71 */
  182. /* significant figures required 30.15 */
  183. /* decimal places required 32.63 */
  184. /* ***REFERENCES (NONE) */
  185. /* ***ROUTINES CALLED D1MACH, DCSEVL, INITDS */
  186. /* ***REVISION HISTORY (YYMMDD) */
  187. /* 770701 DATE WRITTEN */
  188. /* 890531 Changed all specific intrinsics to generic. (WRB) */
  189. /* 890531 REVISION DATE from Version 3.2 */
  190. /* 891214 Prologue converted to Version 4.0 format. (BAB) */
  191. /* ***END PROLOGUE DBSI0E */
  192. /* ***FIRST EXECUTABLE STATEMENT DBSI0E */
  193. y = abs(*x);
  194. if (y > 3.) {
  195. goto L20;
  196. }
  197. ret_val = 1. - *x;
  198. if (y > xsml) {
  199. d__1 = y * y / 4.5 - 1.;
  200. ret_val = exp(-y) * (dcsevl_(&d__1, bi0cs, &nti0) + 2.75);
  201. }
  202. return ret_val;
  203. L20:
  204. if (y <= 8.) {
  205. d__1 = (48. / y - 11.) / 5.;
  206. ret_val = (dcsevl_(&d__1, ai0cs, &ntai0) + .375) / sqrt(y);
  207. }
  208. if (y > 8.) {
  209. d__1 = 16. / y - 1.;
  210. ret_val = (dcsevl_(&d__1, ai02cs, &ntai02) + .375) / sqrt(y);
  211. }
  212. return ret_val;
  213. } /* dbsi0e_ */