dbsi1e.cpp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. /* dbsi1e.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__17 = 17;
  8. static integer const c__46 = 46;
  9. static integer const c__69 = 69;
  10. static integer const c__1 = 1;
  11. /* Initialized data */
  12. static double const bi1cs[17] = { -.0019717132610998597316138503218149,
  13. .40734887667546480608155393652014,
  14. .034838994299959455866245037783787,
  15. .0015453945563001236038598401058489,
  16. 4.188852109837778412945883200412e-5,
  17. 7.6490267648362114741959703966069e-7,
  18. 1.0042493924741178689179808037238e-8,
  19. 9.9322077919238106481371298054863e-11,
  20. 7.6638017918447637275200171681349e-13,
  21. 4.741418923816739498038809194816e-15,
  22. 2.4041144040745181799863172032e-17,
  23. 1.0171505007093713649121100799999e-19,
  24. 3.6450935657866949458491733333333e-22,
  25. 1.1205749502562039344810666666666e-24,
  26. 2.9875441934468088832e-27,
  27. 6.9732310939194709333333333333333e-30,
  28. 1.43679482206208e-32 };
  29. static double const ai1cs[46] = { -.02846744181881478674100372468307,
  30. -.01922953231443220651044448774979,
  31. -6.115185857943788982256249917785e-4,
  32. -2.069971253350227708882823777979e-5,
  33. 8.585619145810725565536944673138e-6,
  34. 1.04949824671159086251745399786e-6,
  35. -2.918338918447902202093432326697e-7,
  36. -1.559378146631739000160680969077e-8,
  37. 1.318012367144944705525302873909e-8,
  38. -1.448423418183078317639134467815e-9,
  39. -2.90851224399314209482504099301e-10,
  40. 1.266388917875382387311159690403e-10,
  41. -1.66494777291922067062417839858e-11,
  42. -1.666653644609432976095937154999e-12,
  43. 1.242602414290768265232168472017e-12,
  44. -2.731549379672432397251461428633e-13,
  45. 2.023947881645803780700262688981e-14,
  46. 7.307950018116883636198698126123e-15,
  47. -3.332905634404674943813778617133e-15,
  48. 7.17534655851295374354225466567e-16,
  49. -6.982530324796256355850629223656e-17,
  50. -1.299944201562760760060446080587e-17,
  51. 8.12094286424279889205467834286e-18,
  52. -2.194016207410736898156266643783e-18,
  53. 3.630516170029654848279860932334e-19,
  54. -1.695139772439104166306866790399e-20,
  55. -1.288184829897907807116882538222e-20,
  56. 5.694428604967052780109991073109e-21,
  57. -1.459597009090480056545509900287e-21,
  58. 2.514546010675717314084691334485e-22,
  59. -1.844758883139124818160400029013e-23,
  60. -6.339760596227948641928609791999e-24,
  61. 3.46144110203101111110814662656e-24,
  62. -1.017062335371393547596541023573e-24,
  63. 2.149877147090431445962500778666e-25,
  64. -3.045252425238676401746206173866e-26,
  65. 5.238082144721285982177634986666e-28,
  66. 1.443583107089382446416789503999e-27,
  67. -6.121302074890042733200670719999e-28,
  68. 1.700011117467818418349189802666e-28,
  69. -3.596589107984244158535215786666e-29,
  70. 5.448178578948418576650513066666e-30,
  71. -2.731831789689084989162564266666e-31,
  72. -1.858905021708600715771903999999e-31,
  73. 9.212682974513933441127765333333e-32,
  74. -2.813835155653561106370833066666e-32 };
  75. static double const ai12cs[69] = { .02857623501828012047449845948469,
  76. -.009761097491361468407765164457302,
  77. -1.105889387626237162912569212775e-4,
  78. -3.882564808877690393456544776274e-6,
  79. -2.512236237870208925294520022121e-7,
  80. -2.631468846889519506837052365232e-8,
  81. -3.835380385964237022045006787968e-9,
  82. -5.589743462196583806868112522229e-10,
  83. -1.897495812350541234498925033238e-11,
  84. 3.252603583015488238555080679949e-11,
  85. 1.412580743661378133163366332846e-11,
  86. 2.03562854414708950722452613684e-12,
  87. -7.198551776245908512092589890446e-13,
  88. -4.083551111092197318228499639691e-13,
  89. -2.101541842772664313019845727462e-14,
  90. 4.272440016711951354297788336997e-14,
  91. 1.042027698412880276417414499948e-14,
  92. -3.814403072437007804767072535396e-15,
  93. -1.880354775510782448512734533963e-15,
  94. 3.308202310920928282731903352405e-16,
  95. 2.962628997645950139068546542052e-16,
  96. -3.209525921993423958778373532887e-17,
  97. -4.650305368489358325571282818979e-17,
  98. 4.414348323071707949946113759641e-18,
  99. 7.517296310842104805425458080295e-18,
  100. -9.314178867326883375684847845157e-19,
  101. -1.242193275194890956116784488697e-18,
  102. 2.414276719454848469005153902176e-19,
  103. 2.026944384053285178971922860692e-19,
  104. -6.394267188269097787043919886811e-20,
  105. -3.049812452373095896084884503571e-20,
  106. 1.612841851651480225134622307691e-20,
  107. 3.56091396430992505451027090462e-21,
  108. -3.752017947936439079666828003246e-21,
  109. -5.787037427074799345951982310741e-23,
  110. 7.759997511648161961982369632092e-22,
  111. -1.452790897202233394064459874085e-22,
  112. -1.318225286739036702121922753374e-22,
  113. 6.116654862903070701879991331717e-23,
  114. 1.376279762427126427730243383634e-23,
  115. -1.690837689959347884919839382306e-23,
  116. 1.430596088595433153987201085385e-24,
  117. 3.409557828090594020405367729902e-24,
  118. -1.309457666270760227845738726424e-24,
  119. -3.940706411240257436093521417557e-25,
  120. 4.277137426980876580806166797352e-25,
  121. -4.424634830982606881900283123029e-26,
  122. -8.734113196230714972115309788747e-26,
  123. 4.045401335683533392143404142428e-26,
  124. 7.067100658094689465651607717806e-27,
  125. -1.249463344565105223002864518605e-26,
  126. 2.867392244403437032979483391426e-27,
  127. 2.04429289250429267028177957421e-27,
  128. -1.518636633820462568371346802911e-27,
  129. 8.110181098187575886132279107037e-29,
  130. 3.58037935477358609112717370327e-28,
  131. -1.692929018927902509593057175448e-28,
  132. -2.222902499702427639067758527774e-29,
  133. 5.424535127145969655048600401128e-29,
  134. -1.787068401578018688764912993304e-29,
  135. -6.56547906872281493882392943788e-30,
  136. 7.807013165061145280922067706839e-30,
  137. -1.816595260668979717379333152221e-30,
  138. -1.287704952660084820376875598959e-30,
  139. 1.114548172988164547413709273694e-30,
  140. -1.808343145039336939159368876687e-31,
  141. -2.231677718203771952232448228939e-31,
  142. 1.619029596080341510617909803614e-31,
  143. -1.83407990880494141390130843921e-32 };
  144. static float const eta = (float) d1mach_(3) * (float).1;
  145. static integer const nti1 = initds_(bi1cs, &c__17, &eta);
  146. static double const xmin = d1mach_(1) * 2.;
  147. static double const xsml = sqrt(d1mach_(3) * 4.5);
  148. static integer const ntai1 = initds_(ai1cs, &c__46, &eta);
  149. static integer const ntai12 = initds_(ai12cs, &c__69, &eta);
  150. double dbsi1e_(double const *x)
  151. {
  152. /* System generated locals */
  153. double ret_val, d__1;
  154. /* Local variables */
  155. double y;
  156. /* ***BEGIN PROLOGUE DBSI1E */
  157. /* ***PURPOSE Compute the exponentially scaled modified (hyperbolic) */
  158. /* Bessel function of the first kind of order one. */
  159. /* ***LIBRARY SLATEC (FNLIB) */
  160. /* ***CATEGORY C10B1 */
  161. /* ***TYPE DOUBLE PRECISION (BESI1E-S, DBSI1E-D) */
  162. /* ***KEYWORDS EXPONENTIALLY SCALED, FIRST KIND, FNLIB, */
  163. /* HYPERBOLIC BESSEL FUNCTION, MODIFIED BESSEL FUNCTION, */
  164. /* ORDER ONE, SPECIAL FUNCTIONS */
  165. /* ***AUTHOR Fullerton, W., (LANL) */
  166. /* ***DESCRIPTION */
  167. /* DBSI1E(X) calculates the double precision exponentially scaled */
  168. /* modified (hyperbolic) Bessel function of the first kind of order */
  169. /* one for double precision argument X. The result is I1(X) */
  170. /* multiplied by EXP(-ABS(X)). */
  171. /* Series for BI1 on the interval 0. to 9.00000E+00 */
  172. /* with weighted error 1.44E-32 */
  173. /* log weighted error 31.84 */
  174. /* significant figures required 31.45 */
  175. /* decimal places required 32.46 */
  176. /* Series for AI1 on the interval 1.25000E-01 to 3.33333E-01 */
  177. /* with weighted error 2.81E-32 */
  178. /* log weighted error 31.55 */
  179. /* significant figures required 29.93 */
  180. /* decimal places required 32.38 */
  181. /* Series for AI12 on the interval 0. to 1.25000E-01 */
  182. /* with weighted error 1.83E-32 */
  183. /* log weighted error 31.74 */
  184. /* significant figures required 29.97 */
  185. /* decimal places required 32.66 */
  186. /* ***REFERENCES (NONE) */
  187. /* ***ROUTINES CALLED D1MACH, DCSEVL, INITDS, XERMSG */
  188. /* ***REVISION HISTORY (YYMMDD) */
  189. /* 770701 DATE WRITTEN */
  190. /* 890531 Changed all specific intrinsics to generic. (WRB) */
  191. /* 890531 REVISION DATE from Version 3.2 */
  192. /* 891214 Prologue converted to Version 4.0 format. (BAB) */
  193. /* 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ) */
  194. /* ***END PROLOGUE DBSI1E */
  195. /* ***FIRST EXECUTABLE STATEMENT DBSI1E */
  196. y = abs(*x);
  197. if (y > 3.) {
  198. goto L20;
  199. }
  200. ret_val = 0.;
  201. if (y == 0.) {
  202. return ret_val;
  203. }
  204. if (y <= xmin) {
  205. xermsg_("SLATEC", "DBSI1E", "ABS(X) SO SMALL I1 UNDERFLOWS", &c__1, &
  206. c__1, (ftnlen)6, (ftnlen)6, (ftnlen)29);
  207. }
  208. if (y > xmin) {
  209. ret_val = *x * .5;
  210. }
  211. if (y > xsml) {
  212. d__1 = y * y / 4.5 - 1.;
  213. ret_val = *x * (dcsevl_(&d__1, bi1cs, &nti1) + .875);
  214. }
  215. ret_val = exp(-y) * ret_val;
  216. return ret_val;
  217. L20:
  218. if (y <= 8.) {
  219. d__1 = (48. / y - 11.) / 5.;
  220. ret_val = (dcsevl_(&d__1, ai1cs, &ntai1) + .375) / sqrt(y);
  221. }
  222. if (y > 8.) {
  223. d__1 = 16. / y - 1.;
  224. ret_val = (dcsevl_(&d__1, ai12cs, &ntai12) + .375) / sqrt(y);
  225. }
  226. ret_val = f2c::d_sign(&ret_val, x);
  227. return ret_val;
  228. } /* dbsi1e_ */