\[\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.4 s
Input Error: 27.5
Output Error: 8.1
Log:
Profile: 🕒
\(\begin{cases} \frac{x.im}{y.re} & \text{when } y.re \le -5.144244344703996 \cdot 10^{+137} \\ \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 -1.0134394410721208 \cdot 10^{-159} \\ \frac{-x.re}{y.im} & \text{when } y.re \le 7.847989728268068 \cdot 10^{-133} \\ \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 1.2667703140962172 \cdot 10^{+134} \\ \frac{x.im}{y.re} & \text{otherwise} \end{cases}\)

    if y.re < -5.144244344703996e+137 or 1.2667703140962172e+134 < 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}\]
      40.6
    2. Using strategy rm
      40.6
    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.5
    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.5
    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.5
    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}}\]
      41.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.144244344703996e+137 < y.re < -1.0134394410721208e-159 or 7.847989728268068e-133 < y.re < 1.2667703140962172e+134

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

    if -1.0134394410721208e-159 < y.re < 7.847989728268068e-133

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      32.3
    2. Using strategy rm
      32.3
    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}}}\]
      32.3
    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}}}\]
      32.3
    5. Using strategy rm
      32.3
    6. Applied add-exp-log to get
      \[\frac{1}{\frac{{y.re}^2 + y.im \cdot y.im}{\color{red}{y.re \cdot x.im - x.re \cdot y.im}}} \leadsto \frac{1}{\frac{{y.re}^2 + y.im \cdot y.im}{\color{blue}{e^{\log \left(y.re \cdot x.im - x.re \cdot y.im\right)}}}}\]
      48.9
    7. Applied add-exp-log to get
      \[\frac{1}{\frac{\color{red}{{y.re}^2 + y.im \cdot y.im}}{e^{\log \left(y.re \cdot x.im - x.re \cdot y.im\right)}}} \leadsto \frac{1}{\frac{\color{blue}{e^{\log \left({y.re}^2 + y.im \cdot y.im\right)}}}{e^{\log \left(y.re \cdot x.im - x.re \cdot y.im\right)}}}\]
      49.0
    8. Applied div-exp to get
      \[\frac{1}{\color{red}{\frac{e^{\log \left({y.re}^2 + y.im \cdot y.im\right)}}{e^{\log \left(y.re \cdot x.im - x.re \cdot y.im\right)}}}} \leadsto \frac{1}{\color{blue}{e^{\log \left({y.re}^2 + y.im \cdot y.im\right) - \log \left(y.re \cdot x.im - x.re \cdot y.im\right)}}}\]
      49.1
    9. Applied taylor to get
      \[\frac{1}{e^{\log \left({y.re}^2 + y.im \cdot y.im\right) - \log \left(y.re \cdot x.im - x.re \cdot y.im\right)}} \leadsto \frac{1}{e^{\log y.im - \left(\log -1 + \log x.re\right)}}\]
      62.7
    10. Taylor expanded around 0 to get
      \[\frac{1}{\color{red}{e^{\log y.im - \left(\log -1 + \log x.re\right)}}} \leadsto \frac{1}{\color{blue}{e^{\log y.im - \left(\log -1 + \log x.re\right)}}}\]
      62.7
    11. Applied simplify to get
      \[\frac{1}{e^{\log y.im - \left(\log -1 + \log x.re\right)}} \leadsto \frac{1}{y.im} \cdot \left(-1 \cdot x.re\right)\]
      0.2

    12. Applied final simplification
    13. Applied simplify to get
      \[\color{red}{\frac{1}{y.im} \cdot \left(-1 \cdot x.re\right)} \leadsto \color{blue}{\frac{-x.re}{y.im}}\]
      0

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