- Split input into 2 regimes
if x.re < -4.2051024255663e-310
Initial program 31.7
\[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 18.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 6.0
\[\leadsto e^{\log \color{blue}{\left(-1 \cdot x.re\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
Simplified6.0
\[\leadsto e^{\log \color{blue}{\left(-x.re\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
if -4.2051024255663e-310 < x.re
Initial program 34.8
\[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 21.7
\[\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 pow-to-exp18.3
\[\leadsto \frac{{x.re}^{y.re}}{\color{blue}{e^{\log \left(e^{y.im}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}}} \cdot 1\]
Applied add-exp-log18.3
\[\leadsto \frac{\color{blue}{e^{\log \left({x.re}^{y.re}\right)}}}{e^{\log \left(e^{y.im}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot 1\]
Applied div-exp18.3
\[\leadsto \color{blue}{e^{\log \left({x.re}^{y.re}\right) - \log \left(e^{y.im}\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot 1\]
Simplified12.0
\[\leadsto e^{\color{blue}{\log x.re \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot 1\]
- Recombined 2 regimes into one program.
Final simplification9.1
\[\leadsto \begin{array}{l}
\mathbf{if}\;x.re \le -4.2051024255663 \cdot 10^{-310}:\\
\;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;e^{\log x.re \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}\]