Make the alias method numerically stable.
Merge pull request #5 from jcazevedo/increase-numerical-stability

Make the alias method numerically stable