using np.logaddexp.reduce