Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Most numerical algorithms require an epsilon to be chosen in order to be robust and provide meaningful results. Choosing machine epsilon is usually too aggressive. Barring any special knowledge about your problem, one rule of thumb I remember is to use $\sqrt{\epsilon_{\text{machine}}}$. Eg: it's mentioned in this wikipedia article. Which basically is the same as assuming that half of the digits in your floating point number are bogus.

But I can't figure out where I got that rule of thumb. I just see it crop up, unreferenced, in various texts. Is there a source for it I could point someone to if they were uninformed about practical issues of numerical algorithms and naively trying to use machine epsilon?

share|improve this question
up vote 3 down vote accepted

The Wikipedia article cite Numerical Recipes, 3rd edition, Section 5.7, which is pages 229-230 (a limited number of page views is available at Sure enough, they provide a derivation to demonstrate that using a one-sided difference quotient, $\sqrt{\varepsilon}$ is a good choice of step-size for finite difference approximations of derivatives. I don't know that $\sqrt{\varepsilon}$ would be great for other choices of algorithm in the absence of problem-specific information. For specific algorithms, you're probably better off trying to get information about your problem, using some reasonable strategies for trial-and-error with different choices of tolerance, and maybe looking up more detailed references for the specific algorithms you're using. A good catch-all reference I like to recommend is Accuracy and Stability of Numerical Algorithms by Nicholas Higham.

share|improve this answer
I love Numerical Recipes. The obsolete versions are free (start from that link on and you can read the whole book. Basically finding a minimum gets the square root of epsilon while finding a root gets epsilon. You need to consider your specific problem. – Ross Millikan Aug 12 '14 at 3:13
Yes, it must have been from Numerical Recipes that I'd seen it. I think I also saw the 1e-6/1e-12 epsilon for floats/doubles for singular value clamping in the section on SVDs, misremembered that as 1e-5/1e-10, thought that they were the square roots of the machine epsilon, and got all mixed up. – Jay Lemmon Aug 12 '14 at 17:08

In the context of the forward difference method of numerical differentiation, the choice of a stepsize that is about $h=\sqrt{\epsilon_{\mbox{machine}}}$ can be justified by an analysis of the truncation and roundoff errors that occur- this particular choice minimizes the sum of the two errors. However, if you switch to a centered difference formula it turns out that $h=\epsilon_{\mbox{machine}}^{1/3}$ is optimal.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.