pan class="math display">\[
\log (a + b)
\ = \
\log (\exp(\log a) + \exp(\log b))
\]</span></p>
<p>The nested log of sum of exponentials is so common, it has its own
name,</p>
<p><span class="math display">\[
\mathrm{log\_sum\_exp}(u, v)
\ = \
\log (\exp(u) + \exp(v)).
\]</span></p>
<p>so that</p>
<p><span class="math display">\[
\log (a + b)
\ = \
\mathrm{log\_sum\_exp}(\log a, \log b).
\]</span></p>
<p>Although it appears this might overflow as soon as exponentiation is
introduced, evaluation does not pro