Initial program 41.2
\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
Simplified41.2
\[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}\]
- Using strategy
rm Applied add-sqr-sqrt41.2
\[\leadsto \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\color{blue}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}}\]
Applied *-un-lft-identity41.2
\[\leadsto \frac{\color{blue}{1 \cdot \mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}\]
Applied times-frac41.2
\[\leadsto \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \cdot \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}}\]
Simplified41.2
\[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}} \cdot \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}\]
Simplified27.1
\[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \color{blue}{\frac{\mathsf{fma}\left(y.im, -x.re, x.im \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}\]
- Using strategy
rm Applied associate-*r/27.0
\[\leadsto \color{blue}{\frac{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \mathsf{fma}\left(y.im, -x.re, x.im \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}\]
Simplified27.0
\[\leadsto \frac{\color{blue}{\frac{\mathsf{fma}\left(y.im, -x.re, x.im \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}}{\mathsf{hypot}\left(y.re, y.im\right)}\]
Taylor expanded around -inf 13.8
\[\leadsto \frac{\color{blue}{x.re}}{\mathsf{hypot}\left(y.re, y.im\right)}\]
Initial program 18.7
\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
Simplified18.7
\[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}\]
- Using strategy
rm Applied add-sqr-sqrt18.7
\[\leadsto \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\color{blue}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}}\]
Applied *-un-lft-identity18.7
\[\leadsto \frac{\color{blue}{1 \cdot \mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}\]
Applied times-frac18.7
\[\leadsto \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \cdot \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}}\]
Simplified18.7
\[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}} \cdot \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}\]
Simplified11.6
\[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \color{blue}{\frac{\mathsf{fma}\left(y.im, -x.re, x.im \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}\]
- Using strategy
rm Applied associate-*r/11.6
\[\leadsto \color{blue}{\frac{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \mathsf{fma}\left(y.im, -x.re, x.im \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}\]
Simplified11.5
\[\leadsto \frac{\color{blue}{\frac{\mathsf{fma}\left(y.im, -x.re, x.im \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}}{\mathsf{hypot}\left(y.re, y.im\right)}\]
- Using strategy
rm Applied clear-num11.6
\[\leadsto \frac{\color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{\mathsf{fma}\left(y.im, -x.re, x.im \cdot y.re\right)}}}}{\mathsf{hypot}\left(y.re, y.im\right)}\]
Simplified11.6
\[\leadsto \frac{\frac{1}{\color{blue}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}}}}{\mathsf{hypot}\left(y.re, y.im\right)}\]
Initial program 39.2
\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
Simplified39.2
\[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}\]
- Using strategy
rm Applied add-sqr-sqrt39.2
\[\leadsto \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\color{blue}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}}\]
Applied *-un-lft-identity39.2
\[\leadsto \frac{\color{blue}{1 \cdot \mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}\]
Applied times-frac39.2
\[\leadsto \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \cdot \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}}\]
Simplified39.2
\[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}} \cdot \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\sqrt{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}\]
Simplified26.6
\[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \color{blue}{\frac{\mathsf{fma}\left(y.im, -x.re, x.im \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}\]
- Using strategy
rm Applied associate-*r/26.6
\[\leadsto \color{blue}{\frac{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \mathsf{fma}\left(y.im, -x.re, x.im \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}\]
Simplified26.6
\[\leadsto \frac{\color{blue}{\frac{\mathsf{fma}\left(y.im, -x.re, x.im \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}}{\mathsf{hypot}\left(y.re, y.im\right)}\]
Taylor expanded around inf 16.3
\[\leadsto \frac{\color{blue}{-1 \cdot x.re}}{\mathsf{hypot}\left(y.re, y.im\right)}\]
Simplified16.3
\[\leadsto \frac{\color{blue}{-x.re}}{\mathsf{hypot}\left(y.re, y.im\right)}\]