- Split input into 2 regimes
if x.re < -3.52123209810406e-310
Initial program 30.5
\[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
Taylor expanded around 0 17.1
\[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{1}\]
Taylor expanded around -inf 5.9
\[\leadsto \color{blue}{e^{-\left(y.re \cdot \log \left(\frac{-1}{x.re}\right) + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot 1\]
Simplified11.3
\[\leadsto \color{blue}{\frac{{\left(-x.re\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}} \cdot 1\]
if -3.52123209810406e-310 < x.re
Initial program 35.0
\[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
Taylor expanded around 0 22.0
\[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{1}\]
Taylor expanded around inf 12.0
\[\leadsto \color{blue}{e^{-\left(y.im \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.re \cdot \log \left(\frac{1}{x.re}\right)\right)}} \cdot 1\]
Simplified16.8
\[\leadsto \color{blue}{\frac{{x.re}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}} \cdot 1\]
- Using strategy
rm Applied add-log-exp16.8
\[\leadsto \color{blue}{\log \left(e^{\frac{{x.re}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}}\right)} \cdot 1\]
- Using strategy
rm Applied add-exp-log16.8
\[\leadsto \log \left(e^{\frac{{x.re}^{y.re}}{\color{blue}{e^{\log \left({\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}}}}\right) \cdot 1\]
Applied pow-to-exp16.8
\[\leadsto \log \left(e^{\frac{\color{blue}{e^{\log x.re \cdot y.re}}}{e^{\log \left({\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}}}\right) \cdot 1\]
Applied div-exp14.3
\[\leadsto \log \left(e^{\color{blue}{e^{\log x.re \cdot y.re - \log \left({\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}}}\right) \cdot 1\]
Simplified12.1
\[\leadsto \log \left(e^{e^{\color{blue}{y.re \cdot \log x.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}}\right) \cdot 1\]
- Recombined 2 regimes into one program.
Final simplification11.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;x.re \le -3.52123209810406 \cdot 10^{-310}:\\
\;\;\;\;\frac{{\left(-x.re\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right)\\
\end{array}\]