Optimzed gaussian probability computation for diagonal matrix.