- Split input into 3 regimes
if re < -6.92029815203542e+145 or -6.947967300568486e-177 < re < -2.4458756963213023e-235
Initial program 51.0
\[\log \left(\sqrt{re \cdot re + im \cdot im}\right)\]
Taylor expanded around -inf 18.9
\[\leadsto \log \color{blue}{\left(-1 \cdot re\right)}\]
Simplified18.9
\[\leadsto \log \color{blue}{\left(-re\right)}\]
if -6.92029815203542e+145 < re < -6.947967300568486e-177 or -2.4458756963213023e-235 < re < 1.0074545562893787e-220 or 1.639720186575044e-191 < re < 2.045862224123966e+89
Initial program 19.3
\[\log \left(\sqrt{re \cdot re + im \cdot im}\right)\]
if 1.0074545562893787e-220 < re < 1.639720186575044e-191 or 2.045862224123966e+89 < re
Initial program 45.3
\[\log \left(\sqrt{re \cdot re + im \cdot im}\right)\]
Taylor expanded around inf 13.1
\[\leadsto \log \color{blue}{re}\]
- Recombined 3 regimes into one program.
Final simplification18.0
\[\leadsto \begin{array}{l}
\mathbf{if}\;re \le -6.92029815203542 \cdot 10^{+145}:\\
\;\;\;\;\log \left(-re\right)\\
\mathbf{elif}\;re \le -6.947967300568486 \cdot 10^{-177}:\\
\;\;\;\;\log \left(\sqrt{im \cdot im + re \cdot re}\right)\\
\mathbf{elif}\;re \le -2.4458756963213023 \cdot 10^{-235}:\\
\;\;\;\;\log \left(-re\right)\\
\mathbf{elif}\;re \le 1.0074545562893787 \cdot 10^{-220}:\\
\;\;\;\;\log \left(\sqrt{im \cdot im + re \cdot re}\right)\\
\mathbf{elif}\;re \le 1.639720186575044 \cdot 10^{-191}:\\
\;\;\;\;\log re\\
\mathbf{elif}\;re \le 2.045862224123966 \cdot 10^{+89}:\\
\;\;\;\;\log \left(\sqrt{im \cdot im + re \cdot re}\right)\\
\mathbf{else}:\\
\;\;\;\;\log re\\
\end{array}\]