\[\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: 10.8 s
Input Error: 25.7
Output Error: 9.8
Log:
Profile: 🕒
\(\begin{cases} \frac{y.re \cdot x.im}{y.re \cdot y.re + {y.im}^2} - \frac{x.re}{y.im + \frac{y.re \cdot y.re}{y.im}} & \text{when } y.im \le -301171.3496353518 \\ \frac{x.im}{\frac{y.im}{y.re} \cdot y.im + y.re} - \frac{y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im} & \text{when } y.im \le 2.8490945020620453 \cdot 10^{+93} \\ \frac{y.re \cdot x.im}{y.re \cdot y.re + {y.im}^2} - \frac{x.re}{y.im + \frac{y.re \cdot y.re}{y.im}} & \text{otherwise} \end{cases}\)

    if y.im < -301171.3496353518 or 2.8490945020620453e+93 < y.im

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      35.7
    2. Using strategy rm
      35.7
    3. Applied div-sub 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{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}}\]
      35.7
    4. Using strategy rm
      35.7
    5. Applied associate-/l* to get
      \[\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \color{red}{\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}} \leadsto \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \color{blue}{\frac{x.re}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.im}}}\]
      32.7
    6. Applied simplify to get
      \[\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{\color{red}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.im}}} \leadsto \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{\color{blue}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}}}\]
      32.7
    7. Using strategy rm
      32.7
    8. Applied *-un-lft-identity to get
      \[\frac{x.im \cdot y.re}{\color{red}{y.re \cdot y.re + y.im \cdot y.im}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \frac{x.im \cdot y.re}{\color{blue}{1 \cdot \left(y.re \cdot y.re + y.im \cdot y.im\right)}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}}\]
      32.7
    9. Applied times-frac to get
      \[\color{red}{\frac{x.im \cdot y.re}{1 \cdot \left(y.re \cdot y.re + y.im \cdot y.im\right)}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \color{blue}{\frac{x.im}{1} \cdot \frac{y.re}{y.re \cdot y.re + y.im \cdot y.im}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}}\]
      32.7
    10. Applied simplify to get
      \[\frac{x.im}{1} \cdot \color{red}{\frac{y.re}{y.re \cdot y.re + y.im \cdot y.im}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \frac{x.im}{1} \cdot \color{blue}{\frac{y.re}{{y.re}^2 + y.im \cdot y.im}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}}\]
      32.7
    11. Applied taylor to get
      \[\frac{x.im}{1} \cdot \frac{y.re}{{y.re}^2 + y.im \cdot y.im} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \frac{x.im}{1} \cdot \frac{y.re}{{y.re}^2 + y.im \cdot y.im} - \frac{x.re}{y.im + \frac{{y.re}^2}{y.im}}\]
      15.3
    12. Taylor expanded around 0 to get
      \[\frac{x.im}{1} \cdot \frac{y.re}{{y.re}^2 + y.im \cdot y.im} - \frac{x.re}{\color{red}{y.im + \frac{{y.re}^2}{y.im}}} \leadsto \frac{x.im}{1} \cdot \frac{y.re}{{y.re}^2 + y.im \cdot y.im} - \frac{x.re}{\color{blue}{y.im + \frac{{y.re}^2}{y.im}}}\]
      15.3
    13. Applied simplify to get
      \[\frac{x.im}{1} \cdot \frac{y.re}{{y.re}^2 + y.im \cdot y.im} - \frac{x.re}{y.im + \frac{{y.re}^2}{y.im}} \leadsto \frac{\frac{x.im \cdot y.re}{1}}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{\frac{y.re}{y.im} \cdot y.re + y.im}\]
      12.5

    14. Applied final simplification
    15. Applied simplify to get
      \[\color{red}{\frac{\frac{x.im \cdot y.re}{1}}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{\frac{y.re}{y.im} \cdot y.re + y.im}} \leadsto \color{blue}{\frac{y.re \cdot x.im}{y.re \cdot y.re + {y.im}^2} - \frac{x.re}{y.im + \frac{y.re \cdot y.re}{y.im}}}\]
      15.6

    if -301171.3496353518 < y.im < 2.8490945020620453e+93

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      18.0
    2. Using strategy rm
      18.0
    3. Applied div-sub 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{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}}\]
      18.0
    4. Using strategy rm
      18.0
    5. Applied associate-/l* to get
      \[\color{red}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leadsto \color{blue}{\frac{x.im}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.re}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      15.5
    6. Applied simplify to get
      \[\frac{x.im}{\color{red}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.re}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leadsto \frac{x.im}{\color{blue}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      15.5
    7. Applied taylor to get
      \[\frac{x.im}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leadsto \frac{x.im}{\frac{{y.im}^2}{y.re} + y.re} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      5.3
    8. Taylor expanded around 0 to get
      \[\frac{x.im}{\color{red}{\frac{{y.im}^2}{y.re} + y.re}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leadsto \frac{x.im}{\color{blue}{\frac{{y.im}^2}{y.re} + y.re}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      5.3
    9. Applied simplify to get
      \[\frac{x.im}{\frac{{y.im}^2}{y.re} + y.re} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leadsto \frac{x.im}{\frac{y.im}{y.re} \cdot y.im + y.re} - \frac{y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\]
      5.3

    10. Applied final simplification

  1. 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))))