\[\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: 16.9 s
Input Error: 13.2
Output Error: 7.7
Log:
Profile: 🕒
\(\begin{cases} \frac{x.im}{y.re} - \frac{y.im \cdot x.re}{{y.re}^2} & \text{when } y.re \le -3.6455829f+12 \\ {\left(\sqrt[3]{\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}}\right)}^3 & \text{when } y.re \le 7639594.5f0 \\ \frac{x.im}{y.re} - \frac{y.im \cdot x.re}{{y.re}^2} & \text{otherwise} \end{cases}\)

    if y.re < -3.6455829f+12 or 7639594.5f0 < 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}\]
      19.8
    2. Using strategy rm
      19.8
    3. Applied add-cube-cbrt 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[3]{y.re \cdot y.re + y.im \cdot y.im}\right)}^3}}\]
      19.9
    4. Applied simplify to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{red}{\left(\sqrt[3]{y.re \cdot y.re + y.im \cdot y.im}\right)}}^3} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{blue}{\left(\sqrt[3]{{y.re}^2 + y.im \cdot y.im}\right)}}^3}\]
      19.9
    5. Applied taylor to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(\sqrt[3]{{y.re}^2 + y.im \cdot y.im}\right)}^3} \leadsto \frac{x.im}{y.re} - \frac{y.im \cdot x.re}{{y.re}^2}\]
      5.7
    6. Taylor expanded around inf to get
      \[\color{red}{\frac{x.im}{y.re} - \frac{y.im \cdot x.re}{{y.re}^2}} \leadsto \color{blue}{\frac{x.im}{y.re} - \frac{y.im \cdot x.re}{{y.re}^2}}\]
      5.7

    if -3.6455829f+12 < y.re < 7639594.5f0

    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.8
    2. Using strategy rm
      8.8
    3. Applied add-cube-cbrt 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}{{\left(\sqrt[3]{\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}}\right)}^3}\]
      9.1

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