Calculate log(Z) and H