speed up the log likelihood