help-gsl
[Top][All Lists]
Advanced

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

[Help-gsl] Origin of 2nd round-off term "dy" in function central_deriv.c


From: Rene Girard
Subject: [Help-gsl] Origin of 2nd round-off term "dy" in function central_deriv.c
Date: Fri, 16 Feb 2007 21:00:49 -0500 (EST)

All,

On line 24 of the function "central_deriv.c" we have the following line:

double dy = GSL_MAX(fabs(r3),fabs(r5))* fabs(x)*GSL_DBL_EPSILON

I understand the rest of the function very well and I am able to derive the 
equation for the optimal stepsize "h_opt" in function "gsl_deriv_central.c"; 
however, I am trying to look for a derivation for the expression of "dy". I 
have look in numerous textbooks on numerical analysis, in particular the book 
of Conte and de Boor given as a reference in the GSL Reference Manual. I looked 
in:

A. Ralston, "A First Course in Numerical Analysis"
N.J. Higham, "Accuracy and Stability of Numerical Algorithms"
Z. Kopal, "Numerical Analysis" (Helpful for deriving the equation for "h_opt")
E. Isaacson and H.B. Keller,"Analysis of Numerical Methods"
H. Press et al., "Numerical Recipes in C"

I also looked on the internet but no luck there.

Again I undertand  what is done in the rest of these two function but the only 
part that escape me is the expression for "dy". As far as I can see , the 
biggest  absolute value of between the differences "r3" and  "r5" is chosen 
then it is multiplied by the absolute value of "x", the point at which we want 
the derivative, and then multiplied by GSL_DBL_EPSILON. I understand that the 
absolute value of the biggest difference has to be chosen but why does it have 
to be multiplied by the absolute value of "x" ? Could this be related to the 
"curvature scale" of the function or "characteristic scale" over which the 
function change as given by H. Press in "Numerical Recipes in C" (p. 187) ? 

N.J. Higham, "Accuracy and Stability of Numerical Algorithms" on p. 8 of his 
book writes about the relative condition number of f(x) given by:

       c(x) = fabs( x*f'(x)/f(x))

which characterize the relative change in the output from a given relative 
change in the input:

(y_new - y)/y = c(x) * (x_new -x)/x

I could not see a link between these and the expression for "dy".

I would appreciate very much if someone could point me in the right direction 
where I could find an explanation for the expression for "dy". The reason for 
asking that is for the development of function for higher order partial 
derivatives
of functions with two variables. I am aware that the pitfall of numerical 
differentiation is often the round-off error.

Regards

Rene Girard

                
---------------------------------
Now you can have a huge leap forward in email: get the new Yahoo! Mail. 


reply via email to

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