- Split input into 4 regimes
if (/ -1 re) < -1.858417570917196e-126
Initial program 21.9
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
- Using strategy
rm Applied flip-+22.0
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\color{blue}{\frac{\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right) - \left(0 \cdot 0\right) \cdot \left(0 \cdot 0\right)}{\log base \cdot \log base - 0 \cdot 0}}}\]
Applied associate-/r/22.0
\[\leadsto \color{blue}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right) - \left(0 \cdot 0\right) \cdot \left(0 \cdot 0\right)} \cdot \left(\log base \cdot \log base - 0 \cdot 0\right)}\]
Applied simplify22.0
\[\leadsto \color{blue}{\left(\log \left(\sqrt{im \cdot im + re \cdot re}\right) \cdot \frac{\frac{1}{\log base}}{\log base \cdot \log base}\right)} \cdot \left(\log base \cdot \log base - 0 \cdot 0\right)\]
if -1.858417570917196e-126 < (/ -1 re) < -1.1195389962635172e-302
Initial program 54.2
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
Taylor expanded around inf 7.8
\[\leadsto \frac{\color{blue}{\log \left(\frac{1}{re}\right) \cdot \log \left(\frac{1}{base}\right)} + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
Applied simplify7.6
\[\leadsto \color{blue}{1 \cdot \frac{\log re}{\log base}}\]
if -1.1195389962635172e-302 < (/ -1 re) < 1.2013426161859356e-50
Initial program 44.9
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
Taylor expanded around -inf 12.9
\[\leadsto \frac{\log \color{blue}{\left(-1 \cdot re\right)} \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
Applied simplify12.8
\[\leadsto \color{blue}{\frac{\log \left(-re\right)}{\log base}}\]
if 1.2013426161859356e-50 < (/ -1 re)
Initial program 21.7
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
- Using strategy
rm Applied flip-+21.7
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\color{blue}{\frac{\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right) - \left(0 \cdot 0\right) \cdot \left(0 \cdot 0\right)}{\log base \cdot \log base - 0 \cdot 0}}}\]
Applied associate-/r/21.7
\[\leadsto \color{blue}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right) - \left(0 \cdot 0\right) \cdot \left(0 \cdot 0\right)} \cdot \left(\log base \cdot \log base - 0 \cdot 0\right)}\]
Applied simplify21.7
\[\leadsto \color{blue}{\left(\log \left(\sqrt{im \cdot im + re \cdot re}\right) \cdot \frac{\frac{1}{\log base}}{\log base \cdot \log base}\right)} \cdot \left(\log base \cdot \log base - 0 \cdot 0\right)\]
- Recombined 4 regimes into one program.
Applied simplify17.8
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;\frac{-1}{re} \le -1.858417570917196 \cdot 10^{-126}:\\
\;\;\;\;\left(\log \left(\sqrt{im \cdot im + re \cdot re}\right) \cdot \frac{\frac{1}{\log base}}{\log base \cdot \log base}\right) \cdot \left(\log base \cdot \log base - 0 \cdot 0\right)\\
\mathbf{if}\;\frac{-1}{re} \le -1.1195389962635172 \cdot 10^{-302}:\\
\;\;\;\;\frac{\log re}{\log base}\\
\mathbf{if}\;\frac{-1}{re} \le 1.2013426161859356 \cdot 10^{-50}:\\
\;\;\;\;\frac{\log \left(-re\right)}{\log base}\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(\sqrt{im \cdot im + re \cdot re}\right) \cdot \frac{\frac{1}{\log base}}{\log base \cdot \log base}\right) \cdot \left(\log base \cdot \log base - 0 \cdot 0\right)\\
\end{array}}\]