bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] Bug in gsl_sf_exp_mult_e10_e error estimation


From: Szymon Jaroszewicz
Subject: [Bug-gsl] Bug in gsl_sf_exp_mult_e10_e error estimation
Date: Mon, 14 Jan 2008 12:16:10 +0100

There is a bug in error estimation for gsl_sf_exp_mult_e10_e:

gsl_sf_exp_e10_e(10000) gives error estimate 3.911404048e-11

but

gsl_sf_exp_mult_e10_e(10000, 1) gives 3.911012947e-15

so it looks like just multiplying by 1 gives us 4 more digits of
precision.  True error is about 1.6884e-11 (using MPFR
http://ex-cs.sist.ac.jp/~tkouya/try_mpfr.html), so the error is
clearly underestimated.  Changing line:

    const double arg_err = 2.0 * GSL_DBL_EPSILON * fabs(ly);

to

    const double arg_err = 2.0 * GSL_DBL_EPSILON * fabs(x);

seems to fix the problem, but I'm not sure this is correct.


Also, there is a discrepancy in result format between exp_e10 and
exp_mult_e10 for x = 100 and y = 1.
The former returns 2.688 with e10=43, the latter 2.688e43 with e10=0.
It would be nicer to return the first result in both cases, but since
both are correct it might not be worth fixing.

Attached is a file reproducing both cases.

Szymon Jaroszewicz

Attachment: gsl_exp_err.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]