[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gsl] GSL/specfunc/dilog.c
From: |
Peter Rozovski |
Subject: |
[Bug-gsl] GSL/specfunc/dilog.c |
Date: |
Fri, 7 Oct 2005 09:06:32 -0700 |
Dear GSL Team,
It seems to me that there is bug in dilog.c module:
/* Calculates Li_2(x) for real x. Assumes x >= 0.0.
*/
static
int
dilog_xge0(const double x, gsl_sf_result * result)
{
if(x > 2.0) {
gsl_sf_result ser;
const int stat_ser = dilog_series_2(1.0/x, &ser);
const double log_x = log(x);
const double t1 = M_PI*M_PI/3.0;
const double t2 = ser.val;
const double t3 = 0.5*log_x*log_x;
result->val = t1 - t2 - t3;
result->err = GSL_DBL_EPSILON * fabs(log_x) + ser.err;
result->err += GSL_DBL_EPSILON * (fabs(t1) + fabs(t2) + fabs(t3));
result->val += 2.0 * GSL_DBL_EPSILON * fabs(result->val);
return stat_ser;
}
It seems to me that in red line it should be result->err += ...
instead of result->val
+= .
With best regards,
Peter Rozovski
address@hidden
(212) 964-4385
- [Bug-gsl] GSL/specfunc/dilog.c,
Peter Rozovski <=