~ubuntu-branches/ubuntu/oneiric/bogofilter/oneiric-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-04-10 11:08:53 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20100410110853-5w0vep9aa9qqr9lx
Tags: 1.2.1-0ubuntu1
* New upstream bugfix release; LP: #557468.
  - Fixes parsing of the first line of the body in MIME messages;
    LP: #320829.

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