\[\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: 14.1 s
Input Error: 26.1
Output Error: 10.2
Log:
Profile: 🕒
\(\begin{cases} \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.im \le -3.8275299274957544 \cdot 10^{+122} \\ \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 1.2976169318421378 \cdot 10^{+135} \\ \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{otherwise} \end{cases}\)

    if y.im < -3.8275299274957544e+122 or 1.2976169318421378e+135 < 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}\]
      42.0
    2. Using strategy rm
      42.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}}\]
      42.0
    4. Using strategy rm
      42.0
    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}}}\]
      40.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}}}\]
      40.4
    7. Applied taylor to get
      \[\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 \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{y.im + \frac{{y.re}^2}{y.im}}\]
      17.4
    8. Taylor expanded around 0 to get
      \[\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{\color{red}{y.im + \frac{{y.re}^2}{y.im}}} \leadsto \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{\color{blue}{y.im + \frac{{y.re}^2}{y.im}}}\]
      17.4
    9. Applied simplify to get
      \[\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \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 \cdot y.re}{y.im}}\]
      17.4

    10. Applied final simplification
    11. 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 \cdot y.re}{y.im}}} \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}}}\]
      17.4

    if -3.8275299274957544e+122 < y.im < 1.2976169318421378e+135

    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.0
    2. Using strategy rm
      19.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}}\]
      19.0
    4. Using strategy rm
      19.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}\]
      17.0
    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}\]
      17.0
    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}\]
      6.9
    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}\]
      6.9
    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}\]
      6.9

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