\[\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.7 s
Input Error: 12.9
Output Error: 5.8
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 -3.5319744f+18 \\ \frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(\sqrt{{y.re}^2 + y.im \cdot y.im}\right)}^2} & \text{when } y.re \le 2.448105f+07 \\ \frac{x.im}{y.re} - \frac{y.im}{y.re} \cdot \frac{x.re}{y.re} & \text{otherwise} \end{cases}\)

    if y.re < -3.5319744f+18 or 2.448105f+07 < 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}\]
      20.1
    2. Using strategy rm
      20.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}}\]
      20.1
    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}\]
      20.1
    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}\]
      18.9
    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}\]
      18.9
    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 -3.5319744f+18 < y.re < 2.448105f+07

    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.9
    2. Using strategy rm
      8.9
    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}}\]
      8.8
    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}\]
      8.8

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