- Split input into 4 regimes
if (atan2 x.im x.re) < -1.5707982218300465 or 1.5707963267948966 < (atan2 x.im x.re)
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.3
\[\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 0.8
\[\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\]
Simplified0.8
\[\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 -1.5707982218300465 < (atan2 x.im x.re) < -1.5707963267948966
Initial program 31.9
\[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}\]
if -1.5707963267948966 < (atan2 x.im x.re) < 4.120236092806811e-118
Initial program 37.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 26.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 14.3
\[\leadsto e^{\color{blue}{-1 \cdot \left(y.re \cdot \log \left(\frac{1}{x.re}\right)\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
Simplified14.3
\[\leadsto e^{\color{blue}{y.re \cdot \log x.re} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
- Using strategy
rm Applied add-cube-cbrt14.3
\[\leadsto e^{y.re \cdot \color{blue}{\left(\left(\sqrt[3]{\log x.re} \cdot \sqrt[3]{\log x.re}\right) \cdot \sqrt[3]{\log x.re}\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
Applied associate-*r*14.3
\[\leadsto e^{\color{blue}{\left(y.re \cdot \left(\sqrt[3]{\log x.re} \cdot \sqrt[3]{\log x.re}\right)\right) \cdot \sqrt[3]{\log x.re}} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\]
if 4.120236092806811e-118 < (atan2 x.im x.re) < 1.5707963267948966
Initial program 30.9
\[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.9
\[\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 0 1.7
\[\leadsto e^{\color{blue}{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot 1\]
- Recombined 4 regimes into one program.
Final simplification8.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;\tan^{-1}_* \frac{x.im}{x.re} \le -1.5707982218300465:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;\tan^{-1}_* \frac{x.im}{x.re} \le -1.5707963267948966:\\
\;\;\;\;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}\\
\mathbf{elif}\;\tan^{-1}_* \frac{x.im}{x.re} \le 4.120236092806811 \cdot 10^{-118}:\\
\;\;\;\;e^{\sqrt[3]{\log x.re} \cdot \left(\left(\sqrt[3]{\log x.re} \cdot \sqrt[3]{\log x.re}\right) \cdot y.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;\tan^{-1}_* \frac{x.im}{x.re} \le 1.5707963267948966:\\
\;\;\;\;e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}\]