- Split input into 4 regimes
if re < -2.0752208244632336e60
Initial program 45.2
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
Taylor expanded around -inf 10.5
\[\leadsto \frac{\log \color{blue}{\left(-1 \cdot re\right)} \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
Simplified10.5
\[\leadsto \frac{\log \color{blue}{\left(-re\right)} \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
if -2.0752208244632336e60 < re < -2.88208828919163744e-308 or 4.7115991876438505e-204 < re < 6.31625123356129944e37
Initial program 21.2
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
- Using strategy
rm Applied add-sqr-sqrt21.2
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\color{blue}{\sqrt{\log base \cdot \log base + 0.0 \cdot 0.0} \cdot \sqrt{\log base \cdot \log base + 0.0 \cdot 0.0}}}\]
Applied *-un-lft-identity21.2
\[\leadsto \frac{\color{blue}{1 \cdot \left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}}{\sqrt{\log base \cdot \log base + 0.0 \cdot 0.0} \cdot \sqrt{\log base \cdot \log base + 0.0 \cdot 0.0}}\]
Applied times-frac21.2
\[\leadsto \color{blue}{\frac{1}{\sqrt{\log base \cdot \log base + 0.0 \cdot 0.0}} \cdot \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\sqrt{\log base \cdot \log base + 0.0 \cdot 0.0}}}\]
Simplified21.2
\[\leadsto \color{blue}{\frac{1}{\sqrt{{\left(\log base\right)}^{2} + 0.0 \cdot 0.0}}} \cdot \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\sqrt{\log base \cdot \log base + 0.0 \cdot 0.0}}\]
Simplified21.2
\[\leadsto \frac{1}{\sqrt{{\left(\log base\right)}^{2} + 0.0 \cdot 0.0}} \cdot \color{blue}{\frac{\tan^{-1}_* \frac{im}{re} \cdot 0.0 + \log base \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\sqrt{{\left(\log base\right)}^{2} + 0.0 \cdot 0.0}}}\]
if -2.88208828919163744e-308 < re < 4.7115991876438505e-204
Initial program 33.2
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
Taylor expanded around 0 33.8
\[\leadsto \color{blue}{\frac{\log 1 + \log im}{\log 1 + \log base}}\]
Simplified33.8
\[\leadsto \color{blue}{\frac{\log im}{\log base}}\]
if 6.31625123356129944e37 < re
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.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
Taylor expanded around inf 11.3
\[\leadsto \color{blue}{\frac{\log 1 - \log \left(\frac{1}{re}\right)}{\log 1 - \log \left(\frac{1}{base}\right)}}\]
Simplified11.3
\[\leadsto \color{blue}{\frac{\log re}{\log base}}\]
- Recombined 4 regimes into one program.
Final simplification17.8
\[\leadsto \begin{array}{l}
\mathbf{if}\;re \le -2.0752208244632336 \cdot 10^{60}:\\
\;\;\;\;\frac{\log \left(-re\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\\
\mathbf{elif}\;re \le -2.88208828919163744 \cdot 10^{-308}:\\
\;\;\;\;\frac{1}{\sqrt{{\left(\log base\right)}^{2} + 0.0 \cdot 0.0}} \cdot \frac{\tan^{-1}_* \frac{im}{re} \cdot 0.0 + \log base \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\sqrt{{\left(\log base\right)}^{2} + 0.0 \cdot 0.0}}\\
\mathbf{elif}\;re \le 4.7115991876438505 \cdot 10^{-204}:\\
\;\;\;\;\frac{\log im}{\log base}\\
\mathbf{elif}\;re \le 6.31625123356129944 \cdot 10^{37}:\\
\;\;\;\;\frac{1}{\sqrt{{\left(\log base\right)}^{2} + 0.0 \cdot 0.0}} \cdot \frac{\tan^{-1}_* \frac{im}{re} \cdot 0.0 + \log base \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\sqrt{{\left(\log base\right)}^{2} + 0.0 \cdot 0.0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\log re}{\log base}\\
\end{array}\]