avoid branches in innermost computations
Merge pull request #108 from pmineiro/faster

avoid branches in innermost computations