\[\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: 11.6 s
Input Error: 12.7
Output Error: 5.4
Log:
Profile: 🕒
\(\begin{cases} \frac{x.im}{y.re} - \frac{y.im}{y.re} \cdot \frac{x.re}{y.re} & \text{when } y.re \le -1.9353409f+09 \\ \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 } y.re \le 9.809289f+19 \\ \frac{x.im}{y.re} - \frac{y.im}{y.re} \cdot \frac{x.re}{y.re} & \text{otherwise} \end{cases}\)

    if y.re < -1.9353409f+09 or 9.809289f+19 < 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}\]
      21.1
    2. Using strategy rm
      21.1
    3. Applied add-sqr-sqrt to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{\color{red}{y.re \cdot y.re + y.im \cdot y.im}} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^2}}\]
      21.0
    4. Applied simplify to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{red}{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{blue}{\left(\sqrt{{y.re}^2 + y.im \cdot y.im}\right)}}^2}\]
      21.0
    5. Applied taylor to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(\sqrt{{y.re}^2 + y.im \cdot y.im}\right)}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(-1 \cdot y.re\right)}^2}\]
      19.8
    6. Taylor expanded around -inf to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{red}{\left(-1 \cdot y.re\right)}}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{blue}{\left(-1 \cdot y.re\right)}}^2}\]
      19.8
    7. Applied simplify to get
      \[\color{red}{\frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(-1 \cdot y.re\right)}^2}} \leadsto \color{blue}{\frac{x.im}{y.re} - \frac{y.im}{y.re} \cdot \frac{x.re}{y.re}}\]
      0.3

    if -1.9353409f+09 < y.re < 9.809289f+19

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

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