- Split input into 3 regimes
if im < -2.228097761837566e-51 or 1.253012063700988e-140 < im < 9.918304620781304e-17
Initial program 30.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}\]
Simplified30.7
\[\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 *-un-lft-identity30.7
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \color{blue}{\left(1 \cdot \log base\right)}}\]
Applied pow130.7
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log \color{blue}{\left({base}^{1}\right)} \cdot \left(1 \cdot \log base\right)}\]
Applied log-pow30.7
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\color{blue}{\left(1 \cdot \log base\right)} \cdot \left(1 \cdot \log base\right)}\]
Applied swap-sqr30.7
\[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\color{blue}{\left(1 \cdot 1\right) \cdot \left(\log base \cdot \log base\right)}}\]
Applied pow130.7
\[\leadsto \frac{\log \left(\sqrt{\color{blue}{{\left(re \cdot re + im \cdot im\right)}^{1}}}\right) \cdot \log base}{\left(1 \cdot 1\right) \cdot \left(\log base \cdot \log base\right)}\]
Applied sqrt-pow130.7
\[\leadsto \frac{\log \color{blue}{\left({\left(re \cdot re + im \cdot im\right)}^{\left(\frac{1}{2}\right)}\right)} \cdot \log base}{\left(1 \cdot 1\right) \cdot \left(\log base \cdot \log base\right)}\]
Applied log-pow30.7
\[\leadsto \frac{\color{blue}{\left(\frac{1}{2} \cdot \log \left(re \cdot re + im \cdot im\right)\right)} \cdot \log base}{\left(1 \cdot 1\right) \cdot \left(\log base \cdot \log base\right)}\]
Applied associate-*l*30.7
\[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \left(\log \left(re \cdot re + im \cdot im\right) \cdot \log base\right)}}{\left(1 \cdot 1\right) \cdot \left(\log base \cdot \log base\right)}\]
Applied times-frac30.7
\[\leadsto \color{blue}{\frac{\frac{1}{2}}{1 \cdot 1} \cdot \frac{\log \left(re \cdot re + im \cdot im\right) \cdot \log base}{\log base \cdot \log base}}\]
Simplified30.7
\[\leadsto \color{blue}{\frac{1}{2}} \cdot \frac{\log \left(re \cdot re + im \cdot im\right) \cdot \log base}{\log base \cdot \log base}\]
Simplified30.7
\[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\log \left(re \cdot re + im \cdot im\right)}{\log base}}\]
if -2.228097761837566e-51 < im < 1.253012063700988e-140 or 9.918304620781304e-17 < im < 2.172664113277433e+21
Initial program 25.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}\]
Simplified25.4
\[\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 -inf 62.8
\[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{-1}{re}\right)}{\log -1 - \log \left(\frac{-1}{base}\right)}}\]
Simplified11.2
\[\leadsto \color{blue}{-\frac{\log \left(\frac{-1}{re}\right)}{\log base}}\]
- Using strategy
rm Applied add-exp-log11.2
\[\leadsto -\frac{\log \color{blue}{\left(e^{\log \left(\frac{-1}{re}\right)}\right)}}{\log base}\]
Applied rem-log-exp11.2
\[\leadsto -\frac{\color{blue}{\log \left(\frac{-1}{re}\right)}}{\log base}\]
- Using strategy
rm Applied div-inv11.2
\[\leadsto -\color{blue}{\log \left(\frac{-1}{re}\right) \cdot \frac{1}{\log base}}\]
- Using strategy
rm Applied add-cube-cbrt11.3
\[\leadsto -\log \left(\frac{-1}{\color{blue}{\left(\sqrt[3]{re} \cdot \sqrt[3]{re}\right) \cdot \sqrt[3]{re}}}\right) \cdot \frac{1}{\log base}\]
Applied *-un-lft-identity11.3
\[\leadsto -\log \left(\frac{\color{blue}{1 \cdot -1}}{\left(\sqrt[3]{re} \cdot \sqrt[3]{re}\right) \cdot \sqrt[3]{re}}\right) \cdot \frac{1}{\log base}\]
Applied times-frac11.3
\[\leadsto -\log \color{blue}{\left(\frac{1}{\sqrt[3]{re} \cdot \sqrt[3]{re}} \cdot \frac{-1}{\sqrt[3]{re}}\right)} \cdot \frac{1}{\log base}\]
Applied log-prod11.3
\[\leadsto -\color{blue}{\left(\log \left(\frac{1}{\sqrt[3]{re} \cdot \sqrt[3]{re}}\right) + \log \left(\frac{-1}{\sqrt[3]{re}}\right)\right)} \cdot \frac{1}{\log base}\]
if 2.172664113277433e+21 < im
Initial program 40.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}\]
Simplified40.8
\[\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.7
\[\leadsto \color{blue}{\frac{\log im}{\log base}}\]
- Recombined 3 regimes into one program.
Final simplification19.2
\[\leadsto \begin{array}{l}
\mathbf{if}\;im \le -2.228097761837566 \cdot 10^{-51}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{\log \left(re \cdot re + im \cdot im\right)}{\log base}\\
\mathbf{elif}\;im \le 1.253012063700988 \cdot 10^{-140}:\\
\;\;\;\;\left(\log \left(\frac{-1}{\sqrt[3]{re}}\right) + \log \left(\frac{1}{\sqrt[3]{re} \cdot \sqrt[3]{re}}\right)\right) \cdot \frac{-1}{\log base}\\
\mathbf{elif}\;im \le 9.918304620781304 \cdot 10^{-17}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{\log \left(re \cdot re + im \cdot im\right)}{\log base}\\
\mathbf{elif}\;im \le 2.172664113277433 \cdot 10^{+21}:\\
\;\;\;\;\left(\log \left(\frac{-1}{\sqrt[3]{re}}\right) + \log \left(\frac{1}{\sqrt[3]{re} \cdot \sqrt[3]{re}}\right)\right) \cdot \frac{-1}{\log base}\\
\mathbf{else}:\\
\;\;\;\;\frac{\log im}{\log base}\\
\end{array}\]