\[\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: 13.5 s
Input Error: 25.5
Output Error: 9.6
Log:
Profile: 🕒
\(\begin{cases} \frac{x.im}{\frac{y.im}{y.re} \cdot y.im + y.re} - \frac{y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re} & \text{when } y.re \le -6.783646013079365 \cdot 10^{+175} \\ \frac{x.im \cdot y.re}{{y.re}^2 + y.im \cdot y.im} - \frac{x.re}{y.im + \frac{{y.re}^2}{y.im}} & \text{when } y.re \le 3.1080072161722114 \cdot 10^{+139} \\ \frac{x.im}{\frac{y.im}{y.re} \cdot y.im + y.re} - \frac{y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re} & \text{otherwise} \end{cases}\)

    if y.re < -6.783646013079365e+175 or 3.1080072161722114e+139 < y.re

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      43.4
    2. Using strategy rm
      43.4
    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}}\]
      43.4
    4. Using strategy rm
      43.4
    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}}}\]
      43.4
    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}}}\]
      43.4
    7. Using strategy rm
      43.4
    8. 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}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \color{blue}{\frac{x.im}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.re}}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}}\]
      42.5
    9. 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}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \frac{x.im}{\color{blue}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}}\]
      42.5
    10. Applied taylor to get
      \[\frac{x.im}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \frac{x.im}{\frac{{y.im}^2}{y.re} + y.re} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}}\]
      17.0
    11. Taylor expanded around 0 to get
      \[\frac{x.im}{\color{red}{\frac{{y.im}^2}{y.re} + y.re}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \frac{x.im}{\color{blue}{\frac{{y.im}^2}{y.re} + y.re}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}}\]
      17.0
    12. Applied simplify to get
      \[\frac{x.im}{\frac{{y.im}^2}{y.re} + y.re} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \frac{x.im}{\frac{y.im}{y.re} \cdot y.im + y.re} - \frac{y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\]
      13.4

    13. Applied final simplification

    if -6.783646013079365e+175 < y.re < 3.1080072161722114e+139

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      19.5
    2. Using strategy rm
      19.5
    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}}\]
      19.5
    4. Using strategy rm
      19.5
    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}}}\]
      18.0
    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}}}\]
      18.0
    7. Using strategy rm
      18.0
    8. 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}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \color{blue}{\frac{x.im}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.re}}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}}\]
      16.3
    9. 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}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \frac{x.im}{\color{blue}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}}\]
      16.3
    10. Applied taylor to get
      \[\frac{x.im}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}} - \frac{x.re}{\frac{{y.re}^2 + y.im \cdot y.im}{y.im}} \leadsto \frac{x.im}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}} - \frac{x.re}{y.im + \frac{{y.re}^2}{y.im}}\]
      6.5
    11. Taylor expanded around 0 to get
      \[\frac{x.im}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}} - \frac{x.re}{\color{red}{y.im + \frac{{y.re}^2}{y.im}}} \leadsto \frac{x.im}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}} - \frac{x.re}{\color{blue}{y.im + \frac{{y.re}^2}{y.im}}}\]
      6.5
    12. Applied simplify to get
      \[\frac{x.im}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}} - \frac{x.re}{y.im + \frac{{y.re}^2}{y.im}} \leadsto \frac{y.re \cdot x.im}{y.im \cdot y.im + y.re \cdot y.re} - \frac{x.re}{y.im + \frac{y.re}{y.im} \cdot y.re}\]
      8.1

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

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