See: http://www.numerical-recipes.com/