# Choosing epsilons

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?

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 http://www.nrbook.com/empanel/). 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.
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.