\[\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: 12.5 s
Input Error: 12.9
Output Error: 5.6
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 -4.1667425f+09 \\ \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 6.144087f+15 \\ \frac{x.im}{y.re} - \frac{y.im}{y.re} \cdot \frac{x.re}{y.re} & \text{otherwise} \end{cases}\)

    if y.re < -4.1667425f+09 or 6.144087f+15 < 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.5
    2. Using strategy rm
      20.5
    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.5
    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.5
    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.1
    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.1
    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 -4.1667425f+09 < y.re < 6.144087f+15

    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.6
    2. Using strategy rm
      8.6
    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.6
    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.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))))