Blame integration/qk51.c

Packit 67cb25
/* integration/qk51.c
Packit 67cb25
 * 
Packit 67cb25
 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough
Packit 67cb25
 * 
Packit 67cb25
 * This program is free software; you can redistribute it and/or modify
Packit 67cb25
 * it under the terms of the GNU General Public License as published by
Packit 67cb25
 * the Free Software Foundation; either version 3 of the License, or (at
Packit 67cb25
 * your option) any later version.
Packit 67cb25
 * 
Packit 67cb25
 * This program is distributed in the hope that it will be useful, but
Packit 67cb25
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 67cb25
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 67cb25
 * General Public License for more details.
Packit 67cb25
 * 
Packit 67cb25
 * You should have received a copy of the GNU General Public License
Packit 67cb25
 * along with this program; if not, write to the Free Software
Packit 67cb25
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit 67cb25
 */
Packit 67cb25
Packit 67cb25
#include <config.h>
Packit 67cb25
#include <gsl/gsl_integration.h>
Packit 67cb25
Packit 67cb25
/* Gauss quadrature weights and kronrod quadrature abscissae and
Packit 67cb25
   weights as evaluated with 80 decimal digit arithmetic by
Packit 67cb25
   L. W. Fullerton, Bell Labs, Nov. 1981. */
Packit 67cb25
Packit 67cb25
static const double xgk[26] =   /* abscissae of the 51-point kronrod rule */
Packit 67cb25
{
Packit 67cb25
  0.999262104992609834193457486540341,
Packit 67cb25
  0.995556969790498097908784946893902,
Packit 67cb25
  0.988035794534077247637331014577406,
Packit 67cb25
  0.976663921459517511498315386479594,
Packit 67cb25
  0.961614986425842512418130033660167,
Packit 67cb25
  0.942974571228974339414011169658471,
Packit 67cb25
  0.920747115281701561746346084546331,
Packit 67cb25
  0.894991997878275368851042006782805,
Packit 67cb25
  0.865847065293275595448996969588340,
Packit 67cb25
  0.833442628760834001421021108693570,
Packit 67cb25
  0.797873797998500059410410904994307,
Packit 67cb25
  0.759259263037357630577282865204361,
Packit 67cb25
  0.717766406813084388186654079773298,
Packit 67cb25
  0.673566368473468364485120633247622,
Packit 67cb25
  0.626810099010317412788122681624518,
Packit 67cb25
  0.577662930241222967723689841612654,
Packit 67cb25
  0.526325284334719182599623778158010,
Packit 67cb25
  0.473002731445714960522182115009192,
Packit 67cb25
  0.417885382193037748851814394594572,
Packit 67cb25
  0.361172305809387837735821730127641,
Packit 67cb25
  0.303089538931107830167478909980339,
Packit 67cb25
  0.243866883720988432045190362797452,
Packit 67cb25
  0.183718939421048892015969888759528,
Packit 67cb25
  0.122864692610710396387359818808037,
Packit 67cb25
  0.061544483005685078886546392366797,
Packit 67cb25
  0.000000000000000000000000000000000
Packit 67cb25
};
Packit 67cb25
Packit 67cb25
/* xgk[1], xgk[3], ... abscissae of the 25-point gauss rule. 
Packit 67cb25
   xgk[0], xgk[2], ... abscissae to optimally extend the 25-point gauss rule */
Packit 67cb25
Packit 67cb25
static const double wg[13] =    /* weights of the 25-point gauss rule */
Packit 67cb25
{
Packit 67cb25
  0.011393798501026287947902964113235,
Packit 67cb25
  0.026354986615032137261901815295299,
Packit 67cb25
  0.040939156701306312655623487711646,
Packit 67cb25
  0.054904695975835191925936891540473,
Packit 67cb25
  0.068038333812356917207187185656708,
Packit 67cb25
  0.080140700335001018013234959669111,
Packit 67cb25
  0.091028261982963649811497220702892,
Packit 67cb25
  0.100535949067050644202206890392686,
Packit 67cb25
  0.108519624474263653116093957050117,
Packit 67cb25
  0.114858259145711648339325545869556,
Packit 67cb25
  0.119455763535784772228178126512901,
Packit 67cb25
  0.122242442990310041688959518945852,
Packit 67cb25
  0.123176053726715451203902873079050
Packit 67cb25
};
Packit 67cb25
Packit 67cb25
static const double wgk[26] =   /* weights of the 51-point kronrod rule */
Packit 67cb25
{
Packit 67cb25
  0.001987383892330315926507851882843,
Packit 67cb25
  0.005561932135356713758040236901066,
Packit 67cb25
  0.009473973386174151607207710523655,
Packit 67cb25
  0.013236229195571674813656405846976,
Packit 67cb25
  0.016847817709128298231516667536336,
Packit 67cb25
  0.020435371145882835456568292235939,
Packit 67cb25
  0.024009945606953216220092489164881,
Packit 67cb25
  0.027475317587851737802948455517811,
Packit 67cb25
  0.030792300167387488891109020215229,
Packit 67cb25
  0.034002130274329337836748795229551,
Packit 67cb25
  0.037116271483415543560330625367620,
Packit 67cb25
  0.040083825504032382074839284467076,
Packit 67cb25
  0.042872845020170049476895792439495,
Packit 67cb25
  0.045502913049921788909870584752660,
Packit 67cb25
  0.047982537138836713906392255756915,
Packit 67cb25
  0.050277679080715671963325259433440,
Packit 67cb25
  0.052362885806407475864366712137873,
Packit 67cb25
  0.054251129888545490144543370459876,
Packit 67cb25
  0.055950811220412317308240686382747,
Packit 67cb25
  0.057437116361567832853582693939506,
Packit 67cb25
  0.058689680022394207961974175856788,
Packit 67cb25
  0.059720340324174059979099291932562,
Packit 67cb25
  0.060539455376045862945360267517565,
Packit 67cb25
  0.061128509717053048305859030416293,
Packit 67cb25
  0.061471189871425316661544131965264,
Packit 67cb25
  0.061580818067832935078759824240066
Packit 67cb25
};
Packit 67cb25
Packit 67cb25
/* wgk[25] was calculated from the values of wgk[0..24] */
Packit 67cb25
Packit 67cb25
void
Packit 67cb25
gsl_integration_qk51 (const gsl_function * f, double a, double b,
Packit 67cb25
                      double *result, double *abserr,
Packit 67cb25
                      double *resabs, double *resasc)
Packit 67cb25
{
Packit 67cb25
  double fv1[26], fv2[26];
Packit 67cb25
  gsl_integration_qk (26, xgk, wg, wgk, fv1, fv2, f, a, b, result, abserr, resabs, resasc);
Packit 67cb25
}
Packit 67cb25