This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Absolute error estimates
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: "J.Underwood" <J dot Underwood at open dot ac dot uk>
- Cc: gsl-discuss <gsl-discuss at sources dot redhat dot com>
- Date: Sun, 22 Feb 2004 19:57:05 +0000
- Subject: Re: Absolute error estimates
- References: <F08F052A3BC28440ADA76024D19A95940347FD5A@atlantis.open.ac.uk>
J.Underwood writes:
> I am unable to determine how the error estimate should be calculated
> in terms of GSL_DBL_EPSILON for the various arithmetic operations -
> is this prescribed anywhere for GSL (I've rtfm and the Design
> Document to no avail). Please could you direct me to how the error
> estimate should be calculated in general (naively I would use
> normal error analysis, however looking through various parts of the
> GSL library code, this seems to be incorrect).
Here is a brief explanation:
1. Assume exact inputs (IEEE numbers are assumed exact). No errors on the
inputs.
2. Then propagate errors using normal error analysis
- for simplicity we assume that errors add linearly |x| + |y|,
rather than in quadrature sqrt(x^2+y^2).
- Generally the standard functions (sin, cos, etc) have an error of 1 ulp
- Remember to convert the relative error to an absolute error by
multiplying by the intermediate value itself. Cancellation errors
are then taken into account for addition and subtraction.
- If you call other GSL functions, use the absolute errors returned
by those.
- There are some internal GSL functions which handle errors for
various cases like gsl_sf_exp_mult_err.
3. Final error must be positive, so take absolute value if necessary.
I think that's it, Jerry may have something else to add as he is the
expert on the special functions.
I should try to add something to the design document, maybe with an
example from one of the existing functions.
--
Brian