| 1 | /* integration/qk41.c |
| 2 | * |
| 3 | * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #include "gsl__config.h" |
| 21 | #include "gsl_integration.h" |
| 22 | |
| 23 | /* Gauss quadrature weights and kronrod quadrature abscissae and |
| 24 | weights as evaluated with 80 decimal digit arithmetic by |
| 25 | L. W. Fullerton, Bell Labs, Nov. 1981. */ |
| 26 | |
| 27 | static const double xgk[21] = /* abscissae of the 41-point kronrod rule */ |
| 28 | { |
| 29 | 0.998859031588277663838315576545863, |
| 30 | 0.993128599185094924786122388471320, |
| 31 | 0.981507877450250259193342994720217, |
| 32 | 0.963971927277913791267666131197277, |
| 33 | 0.940822633831754753519982722212443, |
| 34 | 0.912234428251325905867752441203298, |
| 35 | 0.878276811252281976077442995113078, |
| 36 | 0.839116971822218823394529061701521, |
| 37 | 0.795041428837551198350638833272788, |
| 38 | 0.746331906460150792614305070355642, |
| 39 | 0.693237656334751384805490711845932, |
| 40 | 0.636053680726515025452836696226286, |
| 41 | 0.575140446819710315342946036586425, |
| 42 | 0.510867001950827098004364050955251, |
| 43 | 0.443593175238725103199992213492640, |
| 44 | 0.373706088715419560672548177024927, |
| 45 | 0.301627868114913004320555356858592, |
| 46 | 0.227785851141645078080496195368575, |
| 47 | 0.152605465240922675505220241022678, |
| 48 | 0.076526521133497333754640409398838, |
| 49 | 0.000000000000000000000000000000000 |
| 50 | }; |
| 51 | |
| 52 | /* xgk[1], xgk[3], ... abscissae of the 20-point gauss rule. |
| 53 | xgk[0], xgk[2], ... abscissae to optimally extend the 20-point gauss rule */ |
| 54 | |
| 55 | static const double wg[11] = /* weights of the 20-point gauss rule */ |
| 56 | { |
| 57 | 0.017614007139152118311861962351853, |
| 58 | 0.040601429800386941331039952274932, |
| 59 | 0.062672048334109063569506535187042, |
| 60 | 0.083276741576704748724758143222046, |
| 61 | 0.101930119817240435036750135480350, |
| 62 | 0.118194531961518417312377377711382, |
| 63 | 0.131688638449176626898494499748163, |
| 64 | 0.142096109318382051329298325067165, |
| 65 | 0.149172986472603746787828737001969, |
| 66 | 0.152753387130725850698084331955098 |
| 67 | }; |
| 68 | |
| 69 | static const double wgk[21] = /* weights of the 41-point kronrod rule */ |
| 70 | { |
| 71 | 0.003073583718520531501218293246031, |
| 72 | 0.008600269855642942198661787950102, |
| 73 | 0.014626169256971252983787960308868, |
| 74 | 0.020388373461266523598010231432755, |
| 75 | 0.025882133604951158834505067096153, |
| 76 | 0.031287306777032798958543119323801, |
| 77 | 0.036600169758200798030557240707211, |
| 78 | 0.041668873327973686263788305936895, |
| 79 | 0.046434821867497674720231880926108, |
| 80 | 0.050944573923728691932707670050345, |
| 81 | 0.055195105348285994744832372419777, |
| 82 | 0.059111400880639572374967220648594, |
| 83 | 0.062653237554781168025870122174255, |
| 84 | 0.065834597133618422111563556969398, |
| 85 | 0.068648672928521619345623411885368, |
| 86 | 0.071054423553444068305790361723210, |
| 87 | 0.073030690332786667495189417658913, |
| 88 | 0.074582875400499188986581418362488, |
| 89 | 0.075704497684556674659542775376617, |
| 90 | 0.076377867672080736705502835038061, |
| 91 | 0.076600711917999656445049901530102 |
| 92 | }; |
| 93 | |
| 94 | void |
| 95 | gsl_integration_qk41 (const gsl_function * f, double a, double b, |
| 96 | double *result, double *abserr, |
| 97 | double *resabs, double *resasc) |
| 98 | { |
| 99 | double fv1[21], fv2[21]; |
| 100 | gsl_integration_qk (21, xgk, wg, wgk, fv1, fv2, f, a, b, result, abserr, resabs, resasc); |
| 101 | } |
| 102 |