dbesy0.cpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* dbesy0.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__19 = 19;
  7. static integer const c__1 = 1;
  8. static integer const c__2 = 2;
  9. /* Initialized data */
  10. static double const by0cs[19] = { -.01127783939286557321793980546028,
  11. -.1283452375604203460480884531838,
  12. -.1043788479979424936581762276618,
  13. .02366274918396969540924159264613,
  14. -.002090391647700486239196223950342,
  15. 1.039754539390572520999246576381e-4,
  16. -3.369747162423972096718775345037e-6,
  17. 7.729384267670667158521367216371e-8,
  18. -1.324976772664259591443476068964e-9,
  19. 1.764823261540452792100389363158e-11,
  20. -1.881055071580196200602823012069e-13,
  21. 1.641865485366149502792237185749e-15,
  22. -1.19565943860460608574599100672e-17,
  23. 7.377296297440185842494112426666e-20,
  24. -3.906843476710437330740906666666e-22,
  25. 1.79550366443615794982912e-24,
  26. -7.229627125448010478933333333333e-27,
  27. 2.571727931635168597333333333333e-29,
  28. -8.141268814163694933333333333333e-32 };
  29. static double const twodpi = .636619772367581343075535053490057;
  30. static float const r__1 = (float) d1mach_(3) * (float).1;
  31. static integer const nty0 = initds_(by0cs, &c__19, &r__1);
  32. static double const xsml = sqrt(d1mach_(3) * 4.);
  33. double dbesy0_(double const *x)
  34. {
  35. /* System generated locals */
  36. double ret_val, d__1;
  37. /* Local variables */
  38. double y;
  39. double ampl;
  40. double theta;
  41. /* ***BEGIN PROLOGUE DBESY0 */
  42. /* ***PURPOSE Compute the Bessel function of the second kind of order */
  43. /* zero. */
  44. /* ***LIBRARY SLATEC (FNLIB) */
  45. /* ***CATEGORY C10A1 */
  46. /* ***TYPE DOUBLE PRECISION (BESY0-S, DBESY0-D) */
  47. /* ***KEYWORDS BESSEL FUNCTION, FNLIB, ORDER ZERO, SECOND KIND, */
  48. /* SPECIAL FUNCTIONS */
  49. /* ***AUTHOR Fullerton, W., (LANL) */
  50. /* ***DESCRIPTION */
  51. /* DBESY0(X) calculates the double precision Bessel function of the */
  52. /* second kind of order zero for double precision argument X. */
  53. /* Series for BY0 on the interval 0. to 1.60000E+01 */
  54. /* with weighted error 8.14E-32 */
  55. /* log weighted error 31.09 */
  56. /* significant figures required 30.31 */
  57. /* decimal places required 31.73 */
  58. /* ***REFERENCES (NONE) */
  59. /* ***ROUTINES CALLED D1MACH, D9B0MP, DBESJ0, DCSEVL, INITDS, XERMSG */
  60. /* ***REVISION HISTORY (YYMMDD) */
  61. /* 770701 DATE WRITTEN */
  62. /* 890531 Changed all specific intrinsics to generic. (WRB) */
  63. /* 890531 REVISION DATE from Version 3.2 */
  64. /* 891214 Prologue converted to Version 4.0 format. (BAB) */
  65. /* 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ) */
  66. /* ***END PROLOGUE DBESY0 */
  67. /* ***FIRST EXECUTABLE STATEMENT DBESY0 */
  68. if (*x <= 0.) {
  69. xermsg_("SLATEC", "DBESY0", "X IS ZERO OR NEGATIVE", &c__1, &c__2, (
  70. ftnlen)6, (ftnlen)6, (ftnlen)21);
  71. }
  72. if (*x > 4.) {
  73. goto L20;
  74. }
  75. y = 0.;
  76. if (*x > xsml) {
  77. y = *x * *x;
  78. }
  79. d__1 = y * .125 - 1.;
  80. ret_val = twodpi * log(*x * .5) * dbesj0_(x) + .375 + dcsevl_(&d__1,
  81. by0cs, &nty0);
  82. return ret_val;
  83. L20:
  84. d9b0mp_(x, &ampl, &theta);
  85. ret_val = ampl * sin(theta);
  86. return ret_val;
  87. } /* dbesy0_ */