\[\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: 26.7
Output Error: 16.3
Log:
Profile: 🕒
\(\begin{cases} \frac{x.im}{y.re} - \frac{x.re \cdot y.im}{y.re \cdot y.re} & \text{when } y.re \le -9.56679860262573 \cdot 10^{+108} \\ \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 3.904466330705206 \cdot 10^{+88} \\ \frac{x.im}{y.re} - \frac{x.re \cdot y.im}{y.re \cdot y.re} & \text{otherwise} \end{cases}\)

    if y.re < -9.56679860262573e+108 or 3.904466330705206e+88 < 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}\]
      41.6
    2. Using strategy rm
      41.6
    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}}\]
      41.7
    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}\]
      41.7
    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}\]
      12.4
    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}}\]
      12.4
    7. Applied simplify to get
      \[\frac{x.im}{y.re} - \frac{y.im \cdot x.re}{{y.re}^2} \leadsto \frac{x.im}{y.re} - \frac{x.re \cdot y.im}{y.re \cdot y.re}\]
      12.4

    8. Applied final simplification

    if -9.56679860262573e+108 < y.re < 3.904466330705206e+88

    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.2
    2. Using strategy rm
      18.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}}}\]
      18.5
    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}}}\]
      18.5

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