~ubuntu-branches/ubuntu/lucid/bogofilter/lucid-updates

« back to all changes in this revision

Viewing changes to gsl/specfunc/.svn/text-base/cheb_eval.c.svn-base

  • Committer: Bazaar Package Importer
  • Author(s): Loïc Minier
  • Date: 2010-01-11 23:59:07 UTC
  • Revision ID: james.westby@ubuntu.com-20100111235907-66j0p4v17h0gfkfy
Tags: 1.2.0-3ubuntu2
* Compute md5sums for bogofilter
* Cleanup debian/tmp and debian/bogofilter-sqlite
* Honor nocheck in DEB_BUILD_OPTIONS

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
static inline int
 
3
cheb_eval_e(const cheb_series * cs,
 
4
            const double x,
 
5
            gsl_sf_result * result)
 
6
{
 
7
  int j;
 
8
  double d  = 0.0;
 
9
  double dd = 0.0;
 
10
 
 
11
  double y  = (2.0*x - cs->a - cs->b) / (cs->b - cs->a);
 
12
  double y2 = 2.0 * y;
 
13
 
 
14
  double e = 0.0;
 
15
 
 
16
  for(j = cs->order; j>=1; j--) {
 
17
    double temp = d;
 
18
    d = y2*d - dd + cs->c[j];
 
19
    e += fabs(y2*temp) + fabs(dd) + fabs(cs->c[j]);
 
20
    dd = temp;
 
21
  }
 
22
 
 
23
  { 
 
24
    double temp = d;
 
25
    d = y*d - dd + 0.5 * cs->c[0];
 
26
    e += fabs(y*temp) + fabs(dd) + 0.5 * fabs(cs->c[0]);
 
27
  }
 
28
 
 
29
  result->val = d;
 
30
  result->err = GSL_DBL_EPSILON * e + fabs(cs->c[cs->order]);
 
31
 
 
32
  return GSL_SUCCESS;
 
33
}
 
34