\[\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: 13.4 s
Input Error: 27.8
Output Error: 7.5
Log:
Profile: 🕒
\(\begin{cases} -\frac{x.re}{y.im} & \text{when } y.im \le -3.3416373575121975 \cdot 10^{+67} \\ \frac{1}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re \cdot x.im - x.re \cdot y.im}} & \text{when } y.im \le -2.270547905392246 \cdot 10^{-181} \\ \frac{x.im}{y.re} & \text{when } y.im \le 6.677726181060612 \cdot 10^{-153} \\ \left(x.im \cdot y.re - x.re \cdot y.im\right) \cdot \frac{1}{y.re \cdot y.re + y.im \cdot y.im} & \text{when } y.im \le 1.2610866829211587 \cdot 10^{+151} \\ -\frac{x.re}{y.im} & \text{otherwise} \end{cases}\)

    if y.im < -3.3416373575121975e+67 or 1.2610866829211587e+151 < y.im

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      40.3
    2. Using strategy rm
      40.3
    3. Applied add-exp-log 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}{e^{\log \left(\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)}}\]
      43.1
    4. Applied taylor to get
      \[e^{\log \left(\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)} \leadsto e^{\left(\log x.re + \log -1\right) - \log y.im}\]
      62.9
    5. Taylor expanded around 0 to get
      \[e^{\color{red}{\left(\log x.re + \log -1\right) - \log y.im}} \leadsto e^{\color{blue}{\left(\log x.re + \log -1\right) - \log y.im}}\]
      62.9
    6. Applied simplify to get
      \[e^{\left(\log x.re + \log -1\right) - \log y.im} \leadsto \frac{-1}{y.im} \cdot x.re\]
      0.2

    7. Applied final simplification
    8. Applied simplify to get
      \[\color{red}{\frac{-1}{y.im} \cdot x.re} \leadsto \color{blue}{-\frac{x.re}{y.im}}\]
      0

    if -3.3416373575121975e+67 < y.im < -2.270547905392246e-181

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      15.8
    2. Using strategy rm
      15.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}}}\]
      16.1
    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}}}\]
      16.1

    if -2.270547905392246e-181 < y.im < 6.677726181060612e-153

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      33.1
    2. Using strategy rm
      33.1
    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}}}\]
      33.1
    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}}}\]
      33.1
    5. Using strategy rm
      33.1
    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}}\]
      33.4
    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 6.677726181060612e-153 < y.im < 1.2610866829211587e+151

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      16.5
    2. Using strategy rm
      16.5
    3. Applied div-inv 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(x.im \cdot y.re - x.re \cdot y.im\right) \cdot \frac{1}{y.re \cdot y.re + y.im \cdot y.im}}\]
      16.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))))