\[\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: 12.2 s
Input Error: 14.6
Output Error: 3.0
Log:
Profile: 🕒
\(\begin{cases} -\frac{x.re}{y.im} & \text{when } y.im \le -4.3477835f+20 \\ \frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(\sqrt{{y.re}^2 + y.im \cdot y.im}\right)}^2} & \text{when } y.im \le -8.791166f-22 \\ \frac{x.im}{y.re} - \frac{y.im}{y.re} \cdot \frac{x.re}{y.re} & \text{when } y.im \le 1.0322674f+10 \\ -\frac{x.re}{y.im} & \text{otherwise} \end{cases}\)

    if y.im < -4.3477835f+20 or 1.0322674f+10 < 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}\]
      20.4
    2. Using strategy rm
      20.4
    3. Applied add-exp-log 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}{e^{\log \left(y.re \cdot y.re + y.im \cdot y.im\right)}}}\]
      20.6
    4. Applied add-exp-log to get
      \[\frac{\color{red}{x.im \cdot y.re - x.re \cdot y.im}}{e^{\log \left(y.re \cdot y.re + y.im \cdot y.im\right)}} \leadsto \frac{\color{blue}{e^{\log \left(x.im \cdot y.re - x.re \cdot y.im\right)}}}{e^{\log \left(y.re \cdot y.re + y.im \cdot y.im\right)}}\]
      26.0
    5. Applied div-exp to get
      \[\color{red}{\frac{e^{\log \left(x.im \cdot y.re - x.re \cdot y.im\right)}}{e^{\log \left(y.re \cdot y.re + y.im \cdot y.im\right)}}} \leadsto \color{blue}{e^{\log \left(x.im \cdot y.re - x.re \cdot y.im\right) - \log \left(y.re \cdot y.re + y.im \cdot y.im\right)}}\]
      26.0
    6. Applied taylor to get
      \[e^{\log \left(x.im \cdot y.re - x.re \cdot y.im\right) - \log \left(y.re \cdot y.re + y.im \cdot y.im\right)} \leadsto e^{\left(\log x.re + \log -1\right) - \log y.im}\]
      30.9
    7. Taylor expanded around 0 to get
      \[\color{red}{e^{\left(\log x.re + \log -1\right) - \log y.im}} \leadsto \color{blue}{e^{\left(\log x.re + \log -1\right) - \log y.im}}\]
      30.9
    8. 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

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

    if -4.3477835f+20 < y.im < -8.791166f-22

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      9.2
    2. Using strategy rm
      9.2
    3. Applied add-sqr-sqrt 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{y.re \cdot y.re + y.im \cdot y.im}\right)}^2}}\]
      9.2
    4. Applied simplify to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{red}{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{blue}{\left(\sqrt{{y.re}^2 + y.im \cdot y.im}\right)}}^2}\]
      9.2

    if -8.791166f-22 < y.im < 1.0322674f+10

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      13.3
    2. Using strategy rm
      13.3
    3. Applied add-sqr-sqrt 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{y.re \cdot y.re + y.im \cdot y.im}\right)}^2}}\]
      13.3
    4. Applied simplify to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{red}{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{blue}{\left(\sqrt{{y.re}^2 + y.im \cdot y.im}\right)}}^2}\]
      13.3
    5. Applied taylor to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(\sqrt{{y.re}^2 + y.im \cdot y.im}\right)}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(-1 \cdot y.re\right)}^2}\]
      10.7
    6. Taylor expanded around -inf to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{red}{\left(-1 \cdot y.re\right)}}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{blue}{\left(-1 \cdot y.re\right)}}^2}\]
      10.7
    7. Applied simplify to get
      \[\color{red}{\frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(-1 \cdot y.re\right)}^2}} \leadsto \color{blue}{\frac{x.im}{y.re} - \frac{y.im}{y.re} \cdot \frac{x.re}{y.re}}\]
      0.9

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