changed computation in log domain