dbesi1.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /* dbesi1.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__1 = 1;
  9. static integer const c__2 = 2;
  10. /* Initialized data */
  11. static double const bi1cs[17] = { -.0019717132610998597316138503218149,
  12. .40734887667546480608155393652014,
  13. .034838994299959455866245037783787,
  14. .0015453945563001236038598401058489,
  15. 4.188852109837778412945883200412e-5,
  16. 7.6490267648362114741959703966069e-7,
  17. 1.0042493924741178689179808037238e-8,
  18. 9.9322077919238106481371298054863e-11,
  19. 7.6638017918447637275200171681349e-13,
  20. 4.741418923816739498038809194816e-15,
  21. 2.4041144040745181799863172032e-17,
  22. 1.0171505007093713649121100799999e-19,
  23. 3.6450935657866949458491733333333e-22,
  24. 1.1205749502562039344810666666666e-24,
  25. 2.9875441934468088832e-27,
  26. 6.9732310939194709333333333333333e-30,
  27. 1.43679482206208e-32 };
  28. static float const r__1 = (float) d1mach_(3) * (float).1;
  29. static integer const nti1 = initds_(bi1cs, &c__17, &r__1);
  30. static double const xmin = d1mach_(1) * 2.;
  31. static double const xsml = sqrt(d1mach_(3) * 4.5);
  32. static double const xmax = log(d1mach_(2));
  33. double dbesi1_(double const *x)
  34. {
  35. /* System generated locals */
  36. double ret_val, d__1;
  37. /* Local variables */
  38. double y;
  39. /* ***BEGIN PROLOGUE DBESI1 */
  40. /* ***PURPOSE Compute the modified (hyperbolic) Bessel function of the */
  41. /* first kind of order one. */
  42. /* ***LIBRARY SLATEC (FNLIB) */
  43. /* ***CATEGORY C10B1 */
  44. /* ***TYPE DOUBLE PRECISION (BESI1-S, DBESI1-D) */
  45. /* ***KEYWORDS FIRST KIND, FNLIB, HYPERBOLIC BESSEL FUNCTION, */
  46. /* MODIFIED BESSEL FUNCTION, ORDER ONE, SPECIAL FUNCTIONS */
  47. /* ***AUTHOR Fullerton, W., (LANL) */
  48. /* ***DESCRIPTION */
  49. /* DBESI1(X) calculates the double precision modified (hyperbolic) */
  50. /* Bessel function of the first kind of order one and double precision */
  51. /* argument X. */
  52. /* Series for BI1 on the interval 0. to 9.00000E+00 */
  53. /* with weighted error 1.44E-32 */
  54. /* log weighted error 31.84 */
  55. /* significant figures required 31.45 */
  56. /* decimal places required 32.46 */
  57. /* ***REFERENCES (NONE) */
  58. /* ***ROUTINES CALLED D1MACH, DBSI1E, DCSEVL, INITDS, XERMSG */
  59. /* ***REVISION HISTORY (YYMMDD) */
  60. /* 770701 DATE WRITTEN */
  61. /* 890531 Changed all specific intrinsics to generic. (WRB) */
  62. /* 890531 REVISION DATE from Version 3.2 */
  63. /* 891214 Prologue converted to Version 4.0 format. (BAB) */
  64. /* 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ) */
  65. /* ***END PROLOGUE DBESI1 */
  66. /* ***FIRST EXECUTABLE STATEMENT DBESI1 */
  67. y = abs(*x);
  68. if (y > 3.) {
  69. goto L20;
  70. }
  71. ret_val = 0.;
  72. if (y == 0.) {
  73. return ret_val;
  74. }
  75. if (y <= xmin) {
  76. xermsg_("SLATEC", "DBESI1", "ABS(X) SO SMALL I1 UNDERFLOWS", &c__1, &
  77. c__1, (ftnlen)6, (ftnlen)6, (ftnlen)29);
  78. }
  79. if (y > xmin) {
  80. ret_val = *x * .5;
  81. }
  82. if (y > xsml) {
  83. d__1 = y * y / 4.5 - 1.;
  84. ret_val = *x * (dcsevl_(&d__1, bi1cs, &nti1) + .875);
  85. }
  86. return ret_val;
  87. L20:
  88. if (y > xmax) {
  89. xermsg_("SLATEC", "DBESI1", "ABS(X) SO BIG I1 OVERFLOWS", &c__2, &
  90. c__2, (ftnlen)6, (ftnlen)6, (ftnlen)26);
  91. }
  92. ret_val = exp(y) * dbsi1e_(x);
  93. return ret_val;
  94. } /* dbesi1_ */