- Split input into 4 regimes
if re < -1.4040311718326974e+116
Initial program 53.4
\[\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}\]
Initial simplification53.4
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\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)}}\]
Simplified8.9
\[\leadsto \color{blue}{\frac{-1}{\log base} \cdot \log \left(\frac{-1}{re}\right)}\]
if -1.4040311718326974e+116 < re < -9.23593812410422e-284 or 3.0659504643188854e-187 < re < 4.7731328248529204e+47
Initial program 19.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}\]
Initial simplification19.2
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}\]
- Using strategy
rm Applied times-frac19.1
\[\leadsto \color{blue}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log base} \cdot \frac{\log base}{\log base}}\]
Simplified19.1
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log base} \cdot \color{blue}{1}\]
if -9.23593812410422e-284 < re < 3.0659504643188854e-187
Initial program 29.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}\]
Initial simplification29.6
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}\]
Taylor expanded around 0 33.7
\[\leadsto \color{blue}{\frac{\log im}{\log base}}\]
if 4.7731328248529204e+47 < re
Initial program 43.3
\[\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}\]
Initial simplification43.3
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}\]
- Using strategy
rm Applied times-frac43.2
\[\leadsto \color{blue}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log base} \cdot \frac{\log base}{\log base}}\]
Simplified43.2
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log base} \cdot \color{blue}{1}\]
Taylor expanded around inf 11.9
\[\leadsto \frac{\log \color{blue}{re}}{\log base} \cdot 1\]
- Recombined 4 regimes into one program.
Final simplification17.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;re \le -1.4040311718326974 \cdot 10^{+116}:\\
\;\;\;\;\frac{-1}{\log base} \cdot \log \left(\frac{-1}{re}\right)\\
\mathbf{elif}\;re \le -9.23593812410422 \cdot 10^{-284}:\\
\;\;\;\;\frac{\log \left(\sqrt{im \cdot im + re \cdot re}\right)}{\log base}\\
\mathbf{elif}\;re \le 3.0659504643188854 \cdot 10^{-187}:\\
\;\;\;\;\frac{\log im}{\log base}\\
\mathbf{elif}\;re \le 4.7731328248529204 \cdot 10^{+47}:\\
\;\;\;\;\frac{\log \left(\sqrt{im \cdot im + re \cdot re}\right)}{\log base}\\
\mathbf{else}:\\
\;\;\;\;\frac{\log re}{\log base}\\
\end{array}\]