Absolute error estimates

Brian Gough bjg@network-theory.co.uk
Sun Feb 22 19:57:00 GMT 2004


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



More information about the Gsl-discuss mailing list