\[ \begin{array}{c}[a, b] = \mathsf{sort}([a, b])\\ \end{array} \]
\[\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right)
\]
↓
\[\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(\mathsf{exp.f64}\left(a\right), 0\right):\\
\;\;\;\;\mathsf{/.f64}\left(b, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{expm1.f64}\left(b\right)\right)\right)\\
\end{array}
\]
(FPCore (a b) :precision binary64 (log.f64 (+.f64 (exp.f64 a) (exp.f64 b))))
↓
(FPCore (a b)
:precision binary64
(if (<=.f64 (exp.f64 a) 0)
(/.f64 b (+.f64 (exp.f64 a) 1))
(log1p.f64 (+.f64 (exp.f64 a) (expm1.f64 b)))))
\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right)
↓
\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(\mathsf{exp.f64}\left(a\right), 0\right):\\
\;\;\;\;\mathsf{/.f64}\left(b, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{expm1.f64}\left(b\right)\right)\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 98.7% |
|---|
| Cost | 25924 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(\mathsf{exp.f64}\left(a\right), 0\right):\\
\;\;\;\;\mathsf{/.f64}\left(b, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 98.5% |
|---|
| Cost | 19648 |
|---|
\[\mathsf{+.f64}\left(\mathsf{log1p.f64}\left(\mathsf{exp.f64}\left(a\right)\right), \mathsf{/.f64}\left(b, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), 1\right)\right)\right)
\]
| Alternative 3 |
|---|
| Accuracy | 98.1% |
|---|
| Cost | 19524 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(\mathsf{exp.f64}\left(a\right), \frac{3602879701896397}{18014398509481984}\right):\\
\;\;\;\;\mathsf{/.f64}\left(b, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p.f64}\left(\mathsf{+.f64}\left(a, \mathsf{exp.f64}\left(b\right)\right)\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 97.5% |
|---|
| Cost | 19396 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(\mathsf{exp.f64}\left(a\right), 0\right):\\
\;\;\;\;\mathsf{/.f64}\left(b, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p.f64}\left(\mathsf{exp.f64}\left(b\right)\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 97.6% |
|---|
| Cost | 13636 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(\mathsf{exp.f64}\left(a\right), \frac{3602879701896397}{18014398509481984}\right):\\
\;\;\;\;\mathsf{/.f64}\left(b, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(a, b\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, b\right)\right)\right)\right)\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 97.0% |
|---|
| Cost | 13252 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(\mathsf{exp.f64}\left(a\right), 0\right):\\
\;\;\;\;\mathsf{/.f64}\left(b, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(2\right)\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Accuracy | 56.4% |
|---|
| Cost | 6852 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(a, -155\right):\\
\;\;\;\;\mathsf{*.f64}\left(b, \frac{1}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, \frac{1}{2}\right), \mathsf{log.f64}\left(2\right)\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Accuracy | 56.4% |
|---|
| Cost | 6724 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(a, -1\right):\\
\;\;\;\;\mathsf{*.f64}\left(b, \frac{1}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log.f64}\left(\mathsf{+.f64}\left(a, 2\right)\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Accuracy | 56.3% |
|---|
| Cost | 6724 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(a, -114\right):\\
\;\;\;\;\mathsf{*.f64}\left(b, \frac{1}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log.f64}\left(\mathsf{+.f64}\left(b, 2\right)\right)\\
\end{array}
\]
| Alternative 10 |
|---|
| Accuracy | 56.3% |
|---|
| Cost | 6724 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(a, -155\right):\\
\;\;\;\;\mathsf{*.f64}\left(b, \frac{1}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p.f64}\left(\mathsf{+.f64}\left(b, 1\right)\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Accuracy | 55.8% |
|---|
| Cost | 6596 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\mathsf{<=.f64}\left(a, -135\right):\\
\;\;\;\;\mathsf{*.f64}\left(b, \frac{1}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log.f64}\left(2\right)\\
\end{array}
\]
| Alternative 12 |
|---|
| Accuracy | 12.0% |
|---|
| Cost | 192 |
|---|
\[\mathsf{*.f64}\left(b, \frac{1}{2}\right)
\]