123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #include "slatec-internal.hpp"
- static integer const c__3 = 3;
- static integer const c__16 = 16;
- static integer const c__1 = 1;
- static integer const c__2 = 2;
- static double const bk0cs[16] = { -.0353273932339027687201140060063153,
- .344289899924628486886344927529213,
- .0359799365153615016265721303687231,
- .00126461541144692592338479508673447,
- 2.28621210311945178608269830297585e-5,
- 2.53479107902614945730790013428354e-7,
- 1.90451637722020885897214059381366e-9,
- 1.03496952576336245851008317853089e-11,
- 4.25981614279108257652445327170133e-14,
- 1.3744654358807508969423832544e-16,
- 3.57089652850837359099688597333333e-19,
- 7.63164366011643737667498666666666e-22,
- 1.36542498844078185908053333333333e-24,
- 2.07527526690666808319999999999999e-27,
- 2.7128142180729856e-30,
- 3.08259388791466666666666666666666e-33 };
- static float const r__1 = (float) d1mach_(3) * (float).1;
- static integer const ntk0 = initds_(bk0cs, &c__16, &r__1);
- static double const xsml = sqrt(d1mach_(3) * 4.);
- static double const xmaxt = -log(d1mach_(1));
- static double const xmax = xmaxt - xmaxt * .5 * log(xmaxt) / (xmaxt + .5);
- double dbesk0_(double const *x)
- {
-
- double ret_val, d__1;
-
- double y;
- if (*x <= 0.) {
- xermsg_("SLATEC", "DBESK0", "X IS ZERO OR NEGATIVE", &c__2, &c__2, (
- ftnlen)6, (ftnlen)6, (ftnlen)21);
- }
- if (*x > 2.) {
- goto L20;
- }
- y = 0.;
- if (*x > xsml) {
- y = *x * *x;
- }
- d__1 = y * .5 - 1.;
- ret_val = -log(*x * .5) * dbesi0_(x) - .25 + dcsevl_(&d__1, bk0cs, &ntk0);
- return ret_val;
- L20:
- ret_val = 0.;
- if (*x > xmax) {
- xermsg_("SLATEC", "DBESK0", "X SO BIG K0 UNDERFLOWS", &c__1, &c__1, (
- ftnlen)6, (ftnlen)6, (ftnlen)22);
- }
- if (*x > xmax) {
- return ret_val;
- }
- ret_val = exp(-(*x)) * dbsk0e_(x);
- return ret_val;
- }
|