Commit d9ddaf60 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

inference: Cosmetic fix to log_q_approx()

parent 5bf396b3
......@@ -126,7 +126,7 @@ double log_q_approx(size_t n, size_t k)
return log_q_approx_small(n, k);
double u = k / sqrt(n);
double v = get_v(u);
double lf = log(v) - log1p(- exp(-v) * (1 + u * u/2)) / 2 - log(2) * 3 / 2
double lf = log(v) - log1p(- exp(-v) * (1 + u * u/2)) / 2 - log(2) * 3 / 2.
- log(u) - log(M_PI);
double g = 2 * v / u - u * log1p(-exp(-v));
return lf - log(n) + sqrt(n) * g;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment