\[\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: 25.7
Output Error: 8.5
Log:
Profile: 🕒
\(\begin{cases} \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.re \le -8.7485824185618 \cdot 10^{+145} \\ \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 7.720496126429738 \cdot 10^{+93} \\ \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{otherwise} \end{cases}\)

    if y.re < -8.7485824185618e+145 or 7.720496126429738e+93 < 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}\]
      40.7
    2. Using strategy rm
      40.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}}\]
      40.7
    4. Using strategy rm
      40.7
    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}\]
      38.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}\]
      38.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}\]
      16.8
    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}\]
      16.8
    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}\]
      12.8

    10. Applied final simplification

    if -8.7485824185618e+145 < y.re < 7.720496126429738e+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.6
    2. Using strategy rm
      18.6
    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.7
    4. Using strategy rm
      18.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}}}\]
      16.9
    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}}}\]
      16.9
    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}}\]
      6.5
    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}}}\]
      6.5
    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}}\]
      6.5

    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}}}\]
      6.5

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