What do you think about the formulas and code source published on this page : <http://www.codeguru.com/Cpp/Cpp/algorithms/article.php/c5115/> ?