Remove ValueError when math.log overflowed