LALSimulation  5.4.0.1-fe68b98
gsl_interpolation_integ_eval.h
Go to the documentation of this file.
1 /* This file is a copy of GSL's
2  * interpolation/integ_eval_macro.h
3  *
4  * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or (at
9  * your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 /* function for doing the spline integral evaluation
22  which is common to both the cspline and akima methods
23  */
24 
25 static inline double
26 integ_eval (double ai, double bi, double ci, double di, double xi, double a,
27  double b)
28 {
29  const double r1 = a - xi;
30  const double r2 = b - xi;
31  const double r12 = r1 + r2;
32  const double bterm = 0.5 * bi * r12;
33  const double cterm = (1.0 / 3.0) * ci * (r1 * r1 + r2 * r2 + r1 * r2);
34  const double dterm = 0.25 * di * r12 * (r1 * r1 + r2 * r2);
35 
36  return (b - a) * (ai + bterm + cterm + dterm);
37 }
const double r2
static const INT4 a
static double integ_eval(double ai, double bi, double ci, double di, double xi, double a, double b)