\[\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: 19.7 s
Input Error: 26.1
Output Error: 24.8
Log:
Profile: 🕒
\(\begin{cases} \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}} & \text{when } \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \le -1.1023752675554962 \cdot 10^{+122} \\ \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} & \text{otherwise} \end{cases}\)

    if (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))) < -1.1023752675554962e+122

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      23.9
    2. Using strategy rm
      23.9
    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}}\]
      24.4
    4. Using strategy rm
      24.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}}}\]
      17.6
    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}}}\]
      17.6

    if -1.1023752675554962e+122 < (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im 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}\]
      26.3
    2. Using strategy rm
      26.3
    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}}\]
      26.3
    4. Using strategy rm
      26.3
    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}\]
      25.6
    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}\]
      25.6

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