- Split input into 3 regimes
if (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (- (* (atan2 x.im x.re) y.re) (* y.im (- (log x.re)))))) < 4.0409364040209e-310
Initial program 34.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 \sin \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 inf 20.4
\[\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}{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - \log \left(\frac{1}{x.re}\right) \cdot y.im\right)}\]
Simplified20.4
\[\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}{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - y.im \cdot \left(-\log x.re\right)\right)}\]
if 4.0409364040209e-310 < (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (- (* (atan2 x.im x.re) y.re) (* y.im (- (log x.re)))))) < 4.38888041602222e+307
Initial program 12.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 \sin \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)\]
if 4.38888041602222e+307 < (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (- (* (atan2 x.im x.re) y.re) (* y.im (- (log x.re))))))
Initial program 33.3
\[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 \sin \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 -inf 24.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}{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - \log \left(\frac{-1}{x.re}\right) \cdot y.im\right)}\]
- Recombined 3 regimes into one program.
Final simplification21.9
\[\leadsto \begin{array}{l}
\mathbf{if}\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - \left(-y.im\right) \cdot \log x.re\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \le 4.0409364040209 \cdot 10^{-310}:\\
\;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - \left(-y.im\right) \cdot \log x.re\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - \left(-y.im\right) \cdot \log x.re\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \le 4.38888041602222 \cdot 10^{+307}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - \log \left(\frac{-1}{x.re}\right) \cdot y.im\right)\\
\end{array}\]