\[\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.8 s
Input Error: 25.4
Output Error: 8.7
Log:
Profile: 🕒
\(\begin{cases} \frac{x.im}{\frac{y.im}{y.re} \cdot y.im + y.re} - \frac{y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im} & \text{when } y.re \le -213268377032.2042 \\ \frac{x.im \cdot y.re}{{y.re}^2 + y.im \cdot y.im} - \frac{x.re}{y.im + \frac{{y.re}^2}{y.im}} & \text{when } y.re \le 1.0222346456089473 \cdot 10^{+104} \\ \frac{x.im}{\frac{y.im}{y.re} \cdot y.im + y.re} - \frac{y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im} & \text{otherwise} \end{cases}\)

    if y.re < -213268377032.2042 or 1.0222346456089473e+104 < 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}\]
      35.1
    2. Using strategy rm
      35.1
    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}}\]
      35.1
    4. Using strategy rm
      35.1
    5. Applied associate-/l* to get
      \[\color{red}{\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} \leadsto \color{blue}{\frac{x.im}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.re}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      32.6
    6. Applied simplify to get
      \[\frac{x.im}{\color{red}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.re}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leadsto \frac{x.im}{\color{blue}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      32.6
    7. Applied taylor to get
      \[\frac{x.im}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leadsto \frac{x.im}{\frac{{y.im}^2}{y.re} + y.re} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      16.6
    8. Taylor expanded around 0 to get
      \[\frac{x.im}{\color{red}{\frac{{y.im}^2}{y.re} + y.re}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leadsto \frac{x.im}{\color{blue}{\frac{{y.im}^2}{y.re} + y.re}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      16.6
    9. Applied simplify to get
      \[\frac{x.im}{\frac{{y.im}^2}{y.re} + y.re} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leadsto \frac{x.im}{\frac{y.im}{y.re} \cdot y.im + y.re} - \frac{y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\]
      13.3

    10. Applied final simplification

    if -213268377032.2042 < y.re < 1.0222346456089473e+104

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      18.3
    2. Using strategy rm
      18.3
    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}}\]
      18.4
    4. Using strategy rm
      18.4
    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}}}\]
      15.8
    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}}}\]
      15.8
    7. Applied taylor to get
      \[\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}} \leadsto \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{y.im + \frac{{y.re}^2}{y.im}}\]
      5.3
    8. Taylor expanded around 0 to get
      \[\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{\color{red}{y.im + \frac{{y.re}^2}{y.im}}} \leadsto \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{\color{blue}{y.im + \frac{{y.re}^2}{y.im}}}\]
      5.3
    9. Applied simplify to get
      \[\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{y.im + \frac{{y.re}^2}{y.im}} \leadsto \frac{y.re \cdot x.im}{y.im \cdot y.im + y.re \cdot y.re} - \frac{x.re}{y.im + \frac{y.re \cdot y.re}{y.im}}\]
      5.3

    10. Applied final simplification
    11. Applied simplify to get
      \[\color{red}{\frac{y.re \cdot x.im}{y.im \cdot y.im + y.re \cdot y.re} - \frac{x.re}{y.im + \frac{y.re \cdot y.re}{y.im}}} \leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.re}^2 + y.im \cdot y.im} - \frac{x.re}{y.im + \frac{{y.re}^2}{y.im}}}\]
      5.3

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