~ubuntu-branches/debian/sid/gsl/sid

« back to all changes in this revision

Viewing changes to specfunc/ellint.c

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2008-12-16 06:17:55 UTC
  • mfrom: (1.3.2 upstream) (3.1.15 jaunty)
  • Revision ID: james.westby@ubuntu.com-20081216061755-9la7p0qwrhopk8pl
Tags: 1.12+dfsg-1
* New upstream version released today

* doc/*: As before, removed the 'non-free' documentation to create a 
  source package that complies with Debian's interpretation of what is free. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
481
481
    DOMAIN_ERROR(result);
482
482
  }
483
483
  else if(k*k >= 1.0 - GSL_SQRT_DBL_EPSILON) {
484
 
    /* [Abramowitz+Stegun, 17.3.33] */
 
484
    /* [Abramowitz+Stegun, 17.3.34] */
485
485
    const double y = 1.0 - k*k;
486
486
    const double a[] = { 1.38629436112, 0.09666344259, 0.03590092383 };
487
487
    const double b[] = { 0.5, 0.12498593597, 0.06880248576 };
488
488
    const double ta = a[0] + y*(a[1] + y*a[2]);
489
 
    const double tb = -log(y) * (b[0] * y*(b[1] + y*b[2]));
 
489
    const double tb = -log(y) * (b[0] + y*(b[1] + y*b[2]));
490
490
    result->val = ta + tb;
491
 
    result->err = 2.0 * GSL_DBL_EPSILON * result->val;
 
491
    result->err = 2.0 * GSL_DBL_EPSILON * (fabs(result->val) + fabs(k/y));
492
492
    return GSL_SUCCESS;
493
493
  }
494
494
  else {