Looking at that code I find it really hard to believe that is the intended formula. It's clearly an attempt at logarithmic magnitude in either direction with a time bonus added in. The fact that the typo usually doesn't affect things much is almost guaranteed - if it made results obviously bananas it would have been found sooner.