dbesi0.cpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* dbesi0.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__2 = 2;
  9. /* Initialized data */
  10. static double const bi0cs[18] = { -.07660547252839144951081894976243285,
  11. 1.927337953993808269952408750881196,
  12. .2282644586920301338937029292330415,
  13. .01304891466707290428079334210691888,
  14. 4.344270900816487451378682681026107e-4,
  15. 9.422657686001934663923171744118766e-6,
  16. 1.434006289510691079962091878179957e-7,
  17. 1.613849069661749069915419719994611e-9,
  18. 1.396650044535669699495092708142522e-11,
  19. 9.579451725505445344627523171893333e-14,
  20. 5.333981859862502131015107744e-16,
  21. 2.458716088437470774696785919999999e-18,
  22. 9.535680890248770026944341333333333e-21,
  23. 3.154382039721427336789333333333333e-23,
  24. 9.004564101094637431466666666666666e-26,
  25. 2.240647369123670016e-28,
  26. 4.903034603242837333333333333333333e-31,
  27. 9.508172606122666666666666666666666e-34 };
  28. static float const r__1 = (float) d1mach_(3) * (float).1;
  29. static integer const nti0 = initds_(bi0cs, &c__18, &r__1);
  30. static double const xsml = sqrt(d1mach_(3) * 4.5);
  31. static double const xmax = log(d1mach_(2));
  32. double dbesi0_(double const *x)
  33. {
  34. /* System generated locals */
  35. double ret_val, d__1;
  36. /* Local variables */
  37. double y;
  38. /* ***BEGIN PROLOGUE DBESI0 */
  39. /* ***PURPOSE Compute the hyperbolic Bessel function of the first kind */
  40. /* of order zero. */
  41. /* ***LIBRARY SLATEC (FNLIB) */
  42. /* ***CATEGORY C10B1 */
  43. /* ***TYPE DOUBLE PRECISION (BESI0-S, DBESI0-D) */
  44. /* ***KEYWORDS FIRST KIND, FNLIB, HYPERBOLIC BESSEL FUNCTION, */
  45. /* MODIFIED BESSEL FUNCTION, ORDER ZERO, SPECIAL FUNCTIONS */
  46. /* ***AUTHOR Fullerton, W., (LANL) */
  47. /* ***DESCRIPTION */
  48. /* DBESI0(X) calculates the double precision modified (hyperbolic) */
  49. /* Bessel function of the first kind of order zero and double */
  50. /* precision argument X. */
  51. /* Series for BI0 on the interval 0. to 9.00000E+00 */
  52. /* with weighted error 9.51E-34 */
  53. /* log weighted error 33.02 */
  54. /* significant figures required 33.31 */
  55. /* decimal places required 33.65 */
  56. /* ***REFERENCES (NONE) */
  57. /* ***ROUTINES CALLED D1MACH, DBSI0E, DCSEVL, INITDS, XERMSG */
  58. /* ***REVISION HISTORY (YYMMDD) */
  59. /* 770701 DATE WRITTEN */
  60. /* 890531 Changed all specific intrinsics to generic. (WRB) */
  61. /* 890531 REVISION DATE from Version 3.2 */
  62. /* 891214 Prologue converted to Version 4.0 format. (BAB) */
  63. /* 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ) */
  64. /* ***END PROLOGUE DBESI0 */
  65. /* ***FIRST EXECUTABLE STATEMENT DBESI0 */
  66. y = abs(*x);
  67. if (y > 3.) {
  68. goto L20;
  69. }
  70. ret_val = 1.;
  71. if (y > xsml) {
  72. d__1 = y * y / 4.5 - 1.;
  73. ret_val = dcsevl_(&d__1, bi0cs, &nti0) + 2.75;
  74. }
  75. return ret_val;
  76. L20:
  77. if (y > xmax) {
  78. xermsg_("SLATEC", "DBESI0", "ABS(X) SO BIG I0 OVERFLOWS", &c__2, &
  79. c__2, (ftnlen)6, (ftnlen)6, (ftnlen)26);
  80. }
  81. ret_val = exp(y) * dbsi0e_(x);
  82. return ret_val;
  83. } /* dbesi0_ */