\[\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: 10.3 s
Input Error: 12.4
Output Error: 6.1
Log:
Profile: 🕒
\(\begin{cases} \frac{x.im}{y.re} & \text{when } y.re \le -1.5817318f+16 \\ \frac{1}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re \cdot x.im - x.re \cdot y.im}} & \text{when } y.re \le 6.6680844f+14 \\ \frac{x.im}{y.re} & \text{otherwise} \end{cases}\)

    if y.re < -1.5817318f+16 or 6.6680844f+14 < 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.2
    2. Using strategy rm
      20.2
    3. Applied clear-num 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{1}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.im \cdot y.re - x.re \cdot y.im}}}\]
      20.2
    4. Applied simplify to get
      \[\frac{1}{\color{red}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.im \cdot y.re - x.re \cdot y.im}}} \leadsto \frac{1}{\color{blue}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re \cdot x.im - x.re \cdot y.im}}}\]
      20.2
    5. Using strategy rm
      20.2
    6. Applied add-cube-cbrt to get
      \[\frac{1}{\color{red}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re \cdot x.im - x.re \cdot y.im}}} \leadsto \frac{1}{\color{blue}{{\left(\sqrt[3]{\frac{{y.re}^2 + y.im \cdot y.im}{y.re \cdot x.im - x.re \cdot y.im}}\right)}^3}}\]
      20.2
    7. Applied taylor to get
      \[\frac{1}{{\left(\sqrt[3]{\frac{{y.re}^2 + y.im \cdot y.im}{y.re \cdot x.im - x.re \cdot y.im}}\right)}^3} \leadsto \frac{x.im}{y.re}\]
      0
    8. Taylor expanded around 0 to get
      \[\color{red}{\frac{x.im}{y.re}} \leadsto \color{blue}{\frac{x.im}{y.re}}\]
      0
    9. Applied simplify to get
      \[\frac{x.im}{y.re} \leadsto \frac{x.im}{y.re}\]
      0

    10. Applied final simplification

    if -1.5817318f+16 < y.re < 6.6680844f+14

    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 clear-num 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{1}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.im \cdot y.re - x.re \cdot y.im}}}\]
      9.0
    4. Applied simplify to get
      \[\frac{1}{\color{red}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.im \cdot y.re - x.re \cdot y.im}}} \leadsto \frac{1}{\color{blue}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re \cdot x.im - x.re \cdot y.im}}}\]
      9.0

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