\[\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.6 s
Input Error: 24.9
Output Error: 5.6
Log:
Profile: 🕒
\(\begin{cases} \frac{x.im}{y.re} & \text{when } y.re \le -5.1566700865017865 \cdot 10^{+150} \\ \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 8.948700679365301 \cdot 10^{+158} \\ \frac{x.im}{y.re} & \text{otherwise} \end{cases}\)

    if y.re < -5.1566700865017865e+150 or 8.948700679365301e+158 < 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}\]
      42.3
    2. Using strategy rm
      42.3
    3. Applied add-cbrt-cube 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}{\sqrt[3]{{\left(y.re \cdot y.re + y.im \cdot y.im\right)}^3}}}\]
      42.7
    4. Applied add-cbrt-cube to get
      \[\frac{\color{red}{x.im \cdot y.re - x.re \cdot y.im}}{\sqrt[3]{{\left(y.re \cdot y.re + y.im \cdot y.im\right)}^3}} \leadsto \frac{\color{blue}{\sqrt[3]{{\left(x.im \cdot y.re - x.re \cdot y.im\right)}^3}}}{\sqrt[3]{{\left(y.re \cdot y.re + y.im \cdot y.im\right)}^3}}\]
      52.2
    5. Applied cbrt-undiv to get
      \[\color{red}{\frac{\sqrt[3]{{\left(x.im \cdot y.re - x.re \cdot y.im\right)}^3}}{\sqrt[3]{{\left(y.re \cdot y.re + y.im \cdot y.im\right)}^3}}} \leadsto \color{blue}{\sqrt[3]{\frac{{\left(x.im \cdot y.re - x.re \cdot y.im\right)}^3}{{\left(y.re \cdot y.re + y.im \cdot y.im\right)}^3}}}\]
      52.2
    6. Applied simplify to get
      \[\sqrt[3]{\color{red}{\frac{{\left(x.im \cdot y.re - x.re \cdot y.im\right)}^3}{{\left(y.re \cdot y.re + y.im \cdot y.im\right)}^3}}} \leadsto \sqrt[3]{\color{blue}{{\left(\frac{y.re \cdot x.im - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\right)}^3}}\]
      42.6
    7. Applied taylor to get
      \[\sqrt[3]{{\left(\frac{y.re \cdot x.im - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\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 -5.1566700865017865e+150 < y.re < 8.948700679365301e+158

    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.8
    2. Using strategy rm
      18.8
    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.9
    4. Using strategy rm
      18.9
    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}}}\]
      17.4
    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}}}\]
      17.4
    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}}\]
      7.5
    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}}}\]
      7.5
    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}}\]
      7.5

    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}}}\]
      7.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))))