numerically stable probabilistic model