Friday, 11 August 2006

na.numerical analysis - Optimum small number for numerical differentiation

I use the technique given by J.C. Nash in the book "Compact Numerical Methods for Computers".



On page 219, there is the formula



$h=sqrt{epsilon}left(|x|+sqrt{epsilon}right)$



where $epsilon$ is of course machine epsilon. I have also seen the following formula used (apologies, I no longer recall where this was from):



$h=sqrt{epsilon}maxleft(|x|,sqrt{epsilon}right)$



The recipe for second derivatives is similar except that one now uses the cube root of machine epsilon instead of its square root.

No comments:

Post a Comment