improved implementation of gmean

The original implementation has type consistency problem, and is not very efficient. Actually don’t have to check the value of ``tmp``. When you do log(x), it will automatically raise a DomainError when x is negative, and it will return -Inf when x = 0 (this will results in zero eventually).