\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
Test:
_divideComplex, imaginary part
Bits:
128 bits
Bits error versus x.re
Bits error versus x.im
Bits error versus y.re
Bits error versus y.im
Time: 9.9 s
Input Error: 12.8
Output Error: 0.0
Log:
Profile: 🕒
\(\frac{y.re}{\sqrt{y.re^2 + y.im^2}^*} \cdot \frac{x.im}{\sqrt{y.re^2 + y.im^2}^*} - \frac{x.re}{\sqrt{y.re^2 + y.im^2}^*} \cdot \frac{y.im}{\sqrt{y.re^2 + y.im^2}^*}\)
  1. Started with
    \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
    12.8
  2. Applied simplify to get
    \[\color{red}{\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}} \leadsto \color{blue}{\frac{y.re \cdot x.im - y.im \cdot x.re}{(y.im * y.im + \left(y.re \cdot y.re\right))_*}}\]
    12.8
  3. Using strategy rm
    12.8
  4. Applied fma-udef to get
    \[\frac{y.re \cdot x.im - y.im \cdot x.re}{\color{red}{(y.im * y.im + \left(y.re \cdot y.re\right))_*}} \leadsto \frac{y.re \cdot x.im - y.im \cdot x.re}{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}}\]
    12.8
  5. Applied simplify to get
    \[\frac{y.re \cdot x.im - y.im \cdot x.re}{\color{red}{y.im \cdot y.im} + y.re \cdot y.re} \leadsto \frac{y.re \cdot x.im - y.im \cdot x.re}{\color{blue}{{y.im}^2} + y.re \cdot y.re}\]
    12.8
  6. Using strategy rm
    12.8
  7. Applied add-sqr-sqrt to get
    \[\frac{y.re \cdot x.im - y.im \cdot x.re}{\color{red}{{y.im}^2 + y.re \cdot y.re}} \leadsto \frac{y.re \cdot x.im - y.im \cdot x.re}{\color{blue}{{\left(\sqrt{{y.im}^2 + y.re \cdot y.re}\right)}^2}}\]
    12.7
  8. Applied simplify to get
    \[\frac{y.re \cdot x.im - y.im \cdot x.re}{{\color{red}{\left(\sqrt{{y.im}^2 + y.re \cdot y.re}\right)}}^2} \leadsto \frac{y.re \cdot x.im - y.im \cdot x.re}{{\color{blue}{\left(\sqrt{y.re^2 + y.im^2}^*\right)}}^2}\]
    8.2
  9. Applied taylor to get
    \[\frac{y.re \cdot x.im - y.im \cdot x.re}{{\left(\sqrt{y.re^2 + y.im^2}^*\right)}^2} \leadsto \frac{y.re \cdot x.im}{{\left(\sqrt{y.re^2 + y.im^2}^*\right)}^2} - \frac{y.im \cdot x.re}{{\left(\sqrt{y.re^2 + y.im^2}^*\right)}^2}\]
    8.2
  10. Taylor expanded around 0 to get
    \[\color{red}{\frac{y.re \cdot x.im}{{\left(\sqrt{y.re^2 + y.im^2}^*\right)}^2} - \frac{y.im \cdot x.re}{{\left(\sqrt{y.re^2 + y.im^2}^*\right)}^2}} \leadsto \color{blue}{\frac{y.re \cdot x.im}{{\left(\sqrt{y.re^2 + y.im^2}^*\right)}^2} - \frac{y.im \cdot x.re}{{\left(\sqrt{y.re^2 + y.im^2}^*\right)}^2}}\]
    8.2
  11. Applied simplify to get
    \[\frac{y.re \cdot x.im}{{\left(\sqrt{y.re^2 + y.im^2}^*\right)}^2} - \frac{y.im \cdot x.re}{{\left(\sqrt{y.re^2 + y.im^2}^*\right)}^2} \leadsto \frac{y.re}{\sqrt{y.re^2 + y.im^2}^*} \cdot \frac{x.im}{\sqrt{y.re^2 + y.im^2}^*} - \frac{x.re}{\sqrt{y.re^2 + y.im^2}^*} \cdot \frac{y.im}{\sqrt{y.re^2 + y.im^2}^*}\]
    0.0

  12. Applied final simplification

  13. Removed slow pow expressions

Original test:


(lambda ((x.re default) (x.im default) (y.re default) (y.im default))
  #:name "_divideComplex, imaginary part"
  (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))