Kullback-Leibler divergence between normal distributions (source code)

= Kullback-Leibler divergence between normal distributions
{c}

For univariate normal distributions,
$$
D_{\mathrm{KL}}\bigl(N(m_1,v_1)\Vert N(m_0,v_0)\bigr)
=\frac12\left[\log\frac{v_0}{v_1}+\frac{v_1+(m_1-m_0)^2}{v_0}-1\right].
$$