d9b0mp.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. /* d9b0mp.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__37 = 37;
  8. static integer const c__39 = 39;
  9. static integer const c__40 = 40;
  10. static integer const c__44 = 44;
  11. static integer const c__4 = 4;
  12. static integer const c__1 = 1;
  13. static integer const c__2 = 2;
  14. /* Initialized data */
  15. static double const bm0cs[37] = { .09211656246827742712573767730182,
  16. -.001050590997271905102480716371755,
  17. 1.470159840768759754056392850952e-5,
  18. -5.058557606038554223347929327702e-7,
  19. 2.787254538632444176630356137881e-8,
  20. -2.062363611780914802618841018973e-9,
  21. 1.870214313138879675138172596261e-10,
  22. -1.969330971135636200241730777825e-11,
  23. 2.325973793999275444012508818052e-12,
  24. -3.009520344938250272851224734482e-13,
  25. 4.194521333850669181471206768646e-14,
  26. -6.219449312188445825973267429564e-15,
  27. 9.718260411336068469601765885269e-16,
  28. -1.588478585701075207366635966937e-16,
  29. 2.700072193671308890086217324458e-17,
  30. -4.750092365234008992477504786773e-18,
  31. 8.61512816260437087319170374656e-19,
  32. -1.605608686956144815745602703359e-19,
  33. 3.066513987314482975188539801599e-20,
  34. -5.987764223193956430696505617066e-21,
  35. 1.192971253748248306489069841066e-21,
  36. -2.420969142044805489484682581333e-22,
  37. 4.996751760510616453371002879999e-23,
  38. -1.047493639351158510095040511999e-23,
  39. 2.227786843797468101048183466666e-24,
  40. -4.801813239398162862370542933333e-25,
  41. 1.047962723470959956476996266666e-25,
  42. -2.3138581656786153251012608e-26,
  43. 5.164823088462674211635199999999e-27,
  44. -1.164691191850065389525401599999e-27,
  45. 2.651788486043319282958336e-28,
  46. -6.092559503825728497691306666666e-29,
  47. 1.411804686144259308038826666666e-29,
  48. -3.298094961231737245750613333333e-30,
  49. 7.763931143074065031714133333333e-31,
  50. -1.841031343661458478421333333333e-31,
  51. 4.395880138594310737100799999999e-32 };
  52. static double const bth0cs[44] = { -.24901780862128936717709793789967,
  53. 4.8550299609623749241048615535485e-4,
  54. -5.4511837345017204950656273563505e-6,
  55. 1.3558673059405964054377445929903e-7,
  56. -5.569139890222762622758321841492e-9,
  57. 3.2609031824994335304004205719468e-10,
  58. -2.4918807862461341125237903877993e-11,
  59. 2.3449377420882520554352413564891e-12,
  60. -2.6096534444310387762177574766136e-13,
  61. 3.3353140420097395105869955014923e-14,
  62. -4.7890000440572684646750770557409e-15,
  63. 7.5956178436192215972642568545248e-16,
  64. -1.3131556016891440382773397487633e-16,
  65. 2.4483618345240857495426820738355e-17,
  66. -4.8805729810618777683256761918331e-18,
  67. 1.0327285029786316149223756361204e-18,
  68. -2.3057633815057217157004744527025e-19,
  69. 5.4044443001892693993017108483765e-20,
  70. -1.3240695194366572724155032882385e-20,
  71. 3.3780795621371970203424792124722e-21,
  72. -8.9457629157111779003026926292299e-22,
  73. 2.4519906889219317090899908651405e-22,
  74. -6.9388422876866318680139933157657e-23,
  75. 2.0228278714890138392946303337791e-23,
  76. -6.0628500002335483105794195371764e-24,
  77. 1.864974896403763538182378839627e-24,
  78. -5.8783732384849894560245036530867e-25,
  79. 1.8958591447999563485531179503513e-25,
  80. -6.2481979372258858959291620728565e-26,
  81. 2.1017901684551024686638633529074e-26,
  82. -7.2084300935209253690813933992446e-27,
  83. 2.5181363892474240867156405976746e-27,
  84. -8.9518042258785778806143945953643e-28,
  85. 3.2357237479762298533256235868587e-28,
  86. -1.1883010519855353657047144113796e-28,
  87. 4.4306286907358104820579231941731e-29,
  88. -1.6761009648834829495792010135681e-29,
  89. 6.4292946921207466972532393966088e-30,
  90. -2.4992261166978652421207213682763e-30,
  91. 9.8399794299521955672828260355318e-31,
  92. -3.9220375242408016397989131626158e-31,
  93. 1.5818107030056522138590618845692e-31,
  94. -6.4525506144890715944344098365426e-32,
  95. 2.6611111369199356137177018346367e-32 };
  96. static double const bm02cs[40] = { .0950041514522838136933086133556,
  97. -3.801864682365670991748081566851e-4,
  98. 2.258339301031481192951829927224e-6,
  99. -3.895725802372228764730621412605e-8,
  100. 1.246886416512081697930990529725e-9,
  101. -6.065949022102503779803835058387e-11,
  102. 4.008461651421746991015275971045e-12,
  103. -3.350998183398094218467298794574e-13,
  104. 3.377119716517417367063264341996e-14,
  105. -3.964585901635012700569356295823e-15,
  106. 5.286111503883857217387939744735e-16,
  107. -7.852519083450852313654640243493e-17,
  108. 1.280300573386682201011634073449e-17,
  109. -2.263996296391429776287099244884e-18,
  110. 4.300496929656790388646410290477e-19,
  111. -8.705749805132587079747535451455e-20,
  112. 1.86586271396209514118144277205e-20,
  113. -4.210482486093065457345086972301e-21,
  114. 9.956676964228400991581627417842e-22,
  115. -2.457357442805313359605921478547e-22,
  116. 6.307692160762031568087353707059e-23,
  117. -1.678773691440740142693331172388e-23,
  118. 4.620259064673904433770878136087e-24,
  119. -1.311782266860308732237693402496e-24,
  120. 3.834087564116302827747922440276e-25,
  121. -1.151459324077741271072613293576e-25,
  122. 3.547210007523338523076971345213e-26,
  123. -1.119218385815004646264355942176e-26,
  124. 3.611879427629837831698404994257e-27,
  125. -1.190687765913333150092641762463e-27,
  126. 4.005094059403968131802476449536e-28,
  127. -1.373169422452212390595193916017e-28,
  128. 4.794199088742531585996491526437e-29,
  129. -1.702965627624109584006994476452e-29,
  130. 6.149512428936330071503575161324e-30,
  131. -2.255766896581828349944300237242e-30,
  132. 8.3997075092942994860616583532e-31,
  133. -3.172997595562602355567423936152e-31,
  134. 1.215205298881298554583333026514e-31,
  135. -4.715852749754438693013210568045e-32 };
  136. static double const bt02cs[39] = { -.24548295213424597462050467249324,
  137. .0012544121039084615780785331778299,
  138. -3.1253950414871522854973446709571e-5,
  139. 1.4709778249940831164453426969314e-6,
  140. -9.9543488937950033643468850351158e-8,
  141. 8.5493166733203041247578711397751e-9,
  142. -8.6989759526554334557985512179192e-10,
  143. 1.0052099533559791084540101082153e-10,
  144. -1.2828230601708892903483623685544e-11,
  145. 1.7731700781805131705655750451023e-12,
  146. -2.6174574569485577488636284180925e-13,
  147. 4.0828351389972059621966481221103e-14,
  148. -6.6751668239742720054606749554261e-15,
  149. 1.1365761393071629448392469549951e-15,
  150. -2.0051189620647160250559266412117e-16,
  151. 3.6497978794766269635720591464106e-17,
  152. -6.83096375645823031693558437888e-18,
  153. 1.3107583145670756620057104267946e-18,
  154. -2.5723363101850607778757130649599e-19,
  155. 5.1521657441863959925267780949333e-20,
  156. -1.0513017563758802637940741461333e-20,
  157. 2.1820381991194813847301084501333e-21,
  158. -4.6004701210362160577225905493333e-22,
  159. 9.8407006925466818520953651199999e-23,
  160. -2.1334038035728375844735986346666e-23,
  161. 4.6831036423973365296066286933333e-24,
  162. -1.0400213691985747236513382399999e-24,
  163. 2.33491056773015100517777408e-25,
  164. -5.2956825323318615788049749333333e-26,
  165. 1.2126341952959756829196287999999e-26,
  166. -2.8018897082289428760275626666666e-27,
  167. 6.5292678987012873342593706666666e-28,
  168. -1.5337980061873346427835733333333e-28,
  169. 3.6305884306364536682359466666666e-29,
  170. -8.6560755713629122479172266666666e-30,
  171. 2.0779909972536284571238399999999e-30,
  172. -5.0211170221417221674325333333333e-31,
  173. 1.2208360279441714184191999999999e-31,
  174. -2.9860056267039913454250666666666e-32 };
  175. static double const pi4 = .785398163397448309615660845819876;
  176. static float const eta = (float) d1mach_(3) * (float).1;
  177. static integer const nbm0 = initds_(bm0cs, &c__37, &eta);
  178. static integer const nbm02 = initds_(bm02cs, &c__40, &eta);
  179. static integer const nbt02 = initds_(bt02cs, &c__39, &eta);
  180. static double const xmax = 1. / d1mach_(4);
  181. static integer const nbth0 = initds_(bth0cs, &c__44, &eta);
  182. int d9b0mp_(double const *x, double *ampl, double *theta)
  183. {
  184. /* Local variables */
  185. double z__;
  186. /* ***BEGIN PROLOGUE D9B0MP */
  187. /* ***SUBSIDIARY */
  188. /* ***PURPOSE Evaluate the modulus and phase for the J0 and Y0 Bessel */
  189. /* functions. */
  190. /* ***LIBRARY SLATEC (FNLIB) */
  191. /* ***CATEGORY C10A1 */
  192. /* ***TYPE DOUBLE PRECISION (D9B0MP-D) */
  193. /* ***KEYWORDS BESSEL FUNCTION, FNLIB, MODULUS, PHASE, SPECIAL FUNCTIONS */
  194. /* ***AUTHOR Fullerton, W., (LANL) */
  195. /* ***DESCRIPTION */
  196. /* Evaluate the modulus and phase for the Bessel J0 and Y0 functions. */
  197. /* Series for BM0 on the interval 1.56250E-02 to 6.25000E-02 */
  198. /* with weighted error 4.40E-32 */
  199. /* log weighted error 31.36 */
  200. /* significant figures required 30.02 */
  201. /* decimal places required 32.14 */
  202. /* Series for BTH0 on the interval 0. to 1.56250E-02 */
  203. /* with weighted error 2.66E-32 */
  204. /* log weighted error 31.57 */
  205. /* significant figures required 30.67 */
  206. /* decimal places required 32.40 */
  207. /* Series for BM02 on the interval 0. to 1.56250E-02 */
  208. /* with weighted error 4.72E-32 */
  209. /* log weighted error 31.33 */
  210. /* significant figures required 30.00 */
  211. /* decimal places required 32.13 */
  212. /* Series for BT02 on the interval 1.56250E-02 to 6.25000E-02 */
  213. /* with weighted error 2.99E-32 */
  214. /* log weighted error 31.52 */
  215. /* significant figures required 30.61 */
  216. /* decimal places required 32.32 */
  217. /* ***REFERENCES (NONE) */
  218. /* ***ROUTINES CALLED D1MACH, DCSEVL, INITDS, XERMSG */
  219. /* ***REVISION HISTORY (YYMMDD) */
  220. /* 770701 DATE WRITTEN */
  221. /* 890531 Changed all specific intrinsics to generic. (WRB) */
  222. /* 890531 REVISION DATE from Version 3.2 */
  223. /* 891214 Prologue converted to Version 4.0 format. (BAB) */
  224. /* 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ) */
  225. /* 900720 Routine changed from user-callable to subsidiary. (WRB) */
  226. /* 920618 Removed space from variable names. (RWC, WRB) */
  227. /* ***END PROLOGUE D9B0MP */
  228. /* ***FIRST EXECUTABLE STATEMENT D9B0MP */
  229. if (*x < 4.) {
  230. xermsg_("SLATEC", "D9B0MP", "X MUST BE GE 4", &c__1, &c__2, (ftnlen)6,
  231. (ftnlen)6, (ftnlen)14);
  232. }
  233. if (*x > 8.) {
  234. goto L20;
  235. }
  236. z__ = (128. / (*x * *x) - 5.) / 3.;
  237. *ampl = (dcsevl_(&z__, bm0cs, &nbm0) + .75) / sqrt(*x);
  238. *theta = *x - pi4 + dcsevl_(&z__, bt02cs, &nbt02) / *x;
  239. return 0;
  240. L20:
  241. if (*x > xmax) {
  242. xermsg_("SLATEC", "D9B0MP", "NO PRECISION BECAUSE X IS BIG", &c__2, &
  243. c__2, (ftnlen)6, (ftnlen)6, (ftnlen)29);
  244. }
  245. z__ = 128. / (*x * *x) - 1.;
  246. *ampl = (dcsevl_(&z__, bm02cs, &nbm02) + .75) / sqrt(*x);
  247. *theta = *x - pi4 + dcsevl_(&z__, bth0cs, &nbth0) / *x;
  248. return 0;
  249. } /* d9b0mp_ */