\[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
Test:
_divideComplex, real 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: 5.7 s
Input Error: 12.5
Output Error: 8.0
Log:
Profile: 🕒
\(\frac{(y.re * x.re + \left(y.im \cdot x.im\right))_*}{{\left(\sqrt{y.re^2 + y.im^2}^*\right)}^2}\)
  1. Started with
    \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
    12.5
  2. Applied simplify to get
    \[\color{red}{\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}} \leadsto \color{blue}{\frac{(y.re * x.re + \left(y.im \cdot x.im\right))_*}{(y.im * y.im + \left(y.re \cdot y.re\right))_*}}\]
    12.5
  3. Using strategy rm
    12.5
  4. Applied fma-udef to get
    \[\frac{(y.re * x.re + \left(y.im \cdot x.im\right))_*}{\color{red}{(y.im * y.im + \left(y.re \cdot y.re\right))_*}} \leadsto \frac{(y.re * x.re + \left(y.im \cdot x.im\right))_*}{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}}\]
    12.5
  5. Applied simplify to get
    \[\frac{(y.re * x.re + \left(y.im \cdot x.im\right))_*}{\color{red}{y.im \cdot y.im} + y.re \cdot y.re} \leadsto \frac{(y.re * x.re + \left(y.im \cdot x.im\right))_*}{\color{blue}{{y.im}^2} + y.re \cdot y.re}\]
    12.5
  6. Using strategy rm
    12.5
  7. Applied add-sqr-sqrt to get
    \[\frac{(y.re * x.re + \left(y.im \cdot x.im\right))_*}{\color{red}{{y.im}^2 + y.re \cdot y.re}} \leadsto \frac{(y.re * x.re + \left(y.im \cdot x.im\right))_*}{\color{blue}{{\left(\sqrt{{y.im}^2 + y.re \cdot y.re}\right)}^2}}\]
    12.5
  8. Applied simplify to get
    \[\frac{(y.re * x.re + \left(y.im \cdot x.im\right))_*}{{\color{red}{\left(\sqrt{{y.im}^2 + y.re \cdot y.re}\right)}}^2} \leadsto \frac{(y.re * x.re + \left(y.im \cdot x.im\right))_*}{{\color{blue}{\left(\sqrt{y.re^2 + y.im^2}^*\right)}}^2}\]
    8.0

Original test:


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