Binary relative entropy (source code)

= Binary relative entropy
{title2=$\operatorname{kl}(a,b)$}

The binary relative entropy is the <Kullback-Leibler divergence> between Bernoulli distributions:
$$
\operatorname{kl}(a,b)
=a\log\frac ab+(1-a)\log\frac{1-a}{1-b}.
$$
It is the exact exponent obtained by optimizing the Chernoff bound for a Bernoulli mean.