- Split input into 3 regimes
if re < -7.979458703103105e+118
Initial program 53.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}\]
- Using strategy
rm Applied div-inv53.6
\[\leadsto \color{blue}{\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0\right) \cdot \frac{1}{\log base \cdot \log base + 0 \cdot 0}}\]
Taylor expanded around -inf 8.6
\[\leadsto \left(\log \color{blue}{\left(-1 \cdot re\right)} \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0\right) \cdot \frac{1}{\log base \cdot \log base + 0 \cdot 0}\]
Simplified8.6
\[\leadsto \left(\log \color{blue}{\left(-re\right)} \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0\right) \cdot \frac{1}{\log base \cdot \log base + 0 \cdot 0}\]
if -7.979458703103105e+118 < re < 6.064674052305725e+103
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 clear-num21.7
\[\leadsto \color{blue}{\frac{1}{\frac{\log base \cdot \log base + 0 \cdot 0}{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}}}\]
if 6.064674052305725e+103 < re
Initial program 51.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}\]
Taylor expanded around inf 9.7
\[\leadsto \color{blue}{\frac{\log \left(\frac{1}{re}\right)}{\log \left(\frac{1}{base}\right)}}\]
Simplified9.7
\[\leadsto \color{blue}{\frac{-\log re}{-\log base}}\]
- Recombined 3 regimes into one program.
Final simplification17.6
\[\leadsto \begin{array}{l}
\mathbf{if}\;re \le -7.979458703103105 \cdot 10^{+118}:\\
\;\;\;\;\left(\tan^{-1}_* \frac{im}{re} \cdot 0 + \log base \cdot \log \left(-re\right)\right) \cdot \frac{1}{\log base \cdot \log base + 0 \cdot 0}\\
\mathbf{elif}\;re \le 6.064674052305725 \cdot 10^{+103}:\\
\;\;\;\;\frac{1}{\frac{\log base \cdot \log base + 0 \cdot 0}{\log base \cdot \log \left(\sqrt{im \cdot im + re \cdot re}\right) + \tan^{-1}_* \frac{im}{re} \cdot 0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\log re}{-\log base}\\
\end{array}\]