- Split input into 4 regimes
if im < -8.035597533454974e+155 or -1.5293255908602714e-113 < im < 1.3440029639975817e-158
Initial program 38.6
\[\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}\]
Simplified38.6
\[\leadsto \color{blue}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}}\]
- Using strategy
rm Applied div-inv38.6
\[\leadsto \color{blue}{\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base\right) \cdot \frac{1}{\log base \cdot \log base}}\]
Taylor expanded around -inf 62.8
\[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{-1}{re}\right)}{\log -1 - \log \left(\frac{-1}{base}\right)}}\]
Simplified20.7
\[\leadsto \color{blue}{-\frac{\log \left(\frac{-1}{re}\right)}{\log base}}\]
if -8.035597533454974e+155 < im < -1.5293255908602714e-113
Initial program 15.6
\[\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}\]
Simplified15.6
\[\leadsto \color{blue}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}}\]
- Using strategy
rm Applied div-inv15.6
\[\leadsto \color{blue}{\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base\right) \cdot \frac{1}{\log base \cdot \log base}}\]
if 1.3440029639975817e-158 < im < 1.1171506678820926e+34
Initial program 14.8
\[\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}\]
Simplified14.8
\[\leadsto \color{blue}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}}\]
- Using strategy
rm Applied add-cube-cbrt14.8
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log \color{blue}{\left(\left(\sqrt[3]{base} \cdot \sqrt[3]{base}\right) \cdot \sqrt[3]{base}\right)}}\]
Applied log-prod14.9
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \color{blue}{\left(\log \left(\sqrt[3]{base} \cdot \sqrt[3]{base}\right) + \log \left(\sqrt[3]{base}\right)\right)}}\]
Applied distribute-rgt-in14.9
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\color{blue}{\log \left(\sqrt[3]{base} \cdot \sqrt[3]{base}\right) \cdot \log base + \log \left(\sqrt[3]{base}\right) \cdot \log base}}\]
if 1.1171506678820926e+34 < im
Initial program 43.1
\[\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}\]
Simplified43.1
\[\leadsto \color{blue}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}}\]
Taylor expanded around 0 12.5
\[\leadsto \frac{\log \color{blue}{im} \cdot \log base}{\log base \cdot \log base}\]
- Recombined 4 regimes into one program.
Final simplification16.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;im \le -8.035597533454974 \cdot 10^{+155}:\\
\;\;\;\;-\frac{\log \left(\frac{-1}{re}\right)}{\log base}\\
\mathbf{elif}\;im \le -1.5293255908602714 \cdot 10^{-113}:\\
\;\;\;\;\left(\log base \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)\right) \cdot \frac{1}{\log base \cdot \log base}\\
\mathbf{elif}\;im \le 1.3440029639975817 \cdot 10^{-158}:\\
\;\;\;\;-\frac{\log \left(\frac{-1}{re}\right)}{\log base}\\
\mathbf{elif}\;im \le 1.1171506678820926 \cdot 10^{+34}:\\
\;\;\;\;\frac{\log base \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log base \cdot \log \left(\sqrt[3]{base}\right) + \log base \cdot \log \left(\sqrt[3]{base} \cdot \sqrt[3]{base}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\log im \cdot \log base}{\log base \cdot \log base}\\
\end{array}\]