\[\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: 20.6 s
Input Error: 13.0
Output Error: 4.3
Log:
Profile: 🕒
\(\begin{cases} -\frac{x.re}{y.im} & \text{when } y.im \le -1.0358282f+21 \\ \frac{x.im}{1} \cdot \frac{y.re}{{y.re}^2 + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} & \text{when } y.im \le -3.9317606f-27 \\ \frac{x.im}{y.re} - \frac{y.im}{y.re} \cdot \frac{x.re}{y.re} & \text{when } y.im \le 0.0038476672f0 \\ \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{1} \cdot \frac{y.im}{y.re \cdot y.re + {y.im}^2} & \text{when } y.im \le 1.3808528f+21 \\ -\frac{x.re}{y.im} & \text{otherwise} \end{cases}\)

    if y.im < -1.0358282f+21 or 1.3808528f+21 < 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.9
    2. Using strategy rm
      20.9
    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.9
    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)}}\]
      25.9
    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)}}\]
      25.9
    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 -1.0358282f+21 < y.im < -3.9317606f-27

    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.0
    2. Using strategy rm
      9.0
    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}}\]
      9.0
    4. Using strategy rm
      9.0
    5. Applied *-un-lft-identity to get
      \[\frac{x.im \cdot y.re}{\color{red}{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 \frac{x.im \cdot y.re}{\color{blue}{1 \cdot \left(y.re \cdot y.re + y.im \cdot y.im\right)}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      9.0
    6. Applied times-frac to get
      \[\color{red}{\frac{x.im \cdot y.re}{1 \cdot \left(y.re \cdot y.re + y.im \cdot y.im\right)}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leadsto \color{blue}{\frac{x.im}{1} \cdot \frac{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}\]
      8.3
    7. Applied simplify to get
      \[\frac{x.im}{1} \cdot \color{red}{\frac{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 \frac{x.im}{1} \cdot \color{blue}{\frac{y.re}{{y.re}^2 + y.im \cdot y.im}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      8.3

    if -3.9317606f-27 < y.im < 0.0038476672f0

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

    if 0.0038476672f0 < y.im < 1.3808528f+21

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      10.6
    2. Using strategy rm
      10.6
    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}}\]
      10.6
    4. Using strategy rm
      10.6
    5. Applied *-un-lft-identity to get
      \[\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{\color{red}{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} - \frac{x.re \cdot y.im}{\color{blue}{1 \cdot \left(y.re \cdot y.re + y.im \cdot y.im\right)}}\]
      10.6
    6. Applied times-frac 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}{1 \cdot \left(y.re \cdot y.re + y.im \cdot y.im\right)}} \leadsto \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \color{blue}{\frac{x.re}{1} \cdot \frac{y.im}{y.re \cdot y.re + y.im \cdot y.im}}\]
      8.5
    7. Applied simplify to get
      \[\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{1} \cdot \color{red}{\frac{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} - \frac{x.re}{1} \cdot \color{blue}{\frac{y.im}{y.re \cdot y.re + {y.im}^2}}\]
      8.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))))