123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #include "slatec-internal.hpp"
- static integer const c__3 = 3;
- static integer const c__20 = 20;
- static integer const c__2 = 2;
- static integer const c__1 = 1;
- static double const by1cs[20] = { .0320804710061190862932352018628015,
- 1.26270789743350044953431725999727,
- .00649996189992317500097490637314144,
- -.0893616452886050411653144160009712,
- .0132508812217570954512375510370043,
- -8.97905911964835237753039508298105e-4,
- 3.64736148795830678242287368165349e-5,
- -1.00137438166600055549075523845295e-6,
- 1.99453965739017397031159372421243e-8,
- -3.02306560180338167284799332520743e-10,
- 3.60987815694781196116252914242474e-12,
- -3.48748829728758242414552947409066e-14,
- 2.78387897155917665813507698517333e-16,
- -1.86787096861948768766825352533333e-18,
- 1.06853153391168259757070336e-20,
- -5.27472195668448228943872e-23,
- 2.27019940315566414370133333333333e-25,
- -8.59539035394523108693333333333333e-28,
- 2.88540437983379456e-30,
- -8.64754113893717333333333333333333e-33 };
- static double const twodpi = .636619772367581343075535053490057;
- static float const r__1 = (float) d1mach_(3) * (float).1;
- static integer const nty1 = initds_(by1cs, &c__20, &r__1);
- static double const xmin = exp(max(+log(d1mach_(1)), -log(d1mach_(2))) + .01) * 1.571;
- static double const xsml = sqrt(d1mach_(3) * 4.);
- double dbesy1_(double const *x)
- {
-
- double ret_val, d__1;
-
- double y;
- double ampl;
- double theta;
- if (*x <= 0.) {
- xermsg_("SLATEC", "DBESY1", "X IS ZERO OR NEGATIVE", &c__1, &c__2, (
- ftnlen)6, (ftnlen)6, (ftnlen)21);
- }
- if (*x > 4.) {
- goto L20;
- }
- if (*x < xmin) {
- xermsg_("SLATEC", "DBESY1", "X SO SMALL Y1 OVERFLOWS", &c__3, &c__2, (
- ftnlen)6, (ftnlen)6, (ftnlen)23);
- }
- y = 0.;
- if (*x > xsml) {
- y = *x * *x;
- }
- d__1 = y * .125 - 1.;
- ret_val = twodpi * log(*x * .5) * dbesj1_(x) + (dcsevl_(&d__1, by1cs, &
- nty1) + .5) / *x;
- return ret_val;
- L20:
- d9b1mp_(x, &l, &theta);
- ret_val = ampl * sin(theta);
- return ret_val;
- }
|