\[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
Test:
_divideComplex, real 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.1 s
Input Error: 25.9
Output Error: 12.0
Log:
Profile: 🕒
\(\begin{cases} \frac{x.re}{y.re} & \text{when } y.re \le -1.0880485702476334 \cdot 10^{+152} \\ \frac{1}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re \cdot x.re + x.im \cdot y.im}} & \text{when } y.re \le 3.586178138959661 \cdot 10^{+58} \\ \frac{x.re}{y.re} & \text{otherwise} \end{cases}\)

    if y.re < -1.0880485702476334e+152 or 3.586178138959661e+58 < y.re

    1. Started with
      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      40.8
    2. Using strategy rm
      40.8
    3. Applied add-cbrt-cube to get
      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{\color{red}{y.re \cdot y.re + y.im \cdot y.im}} \leadsto \frac{x.re \cdot y.re + x.im \cdot y.im}{\color{blue}{\sqrt[3]{{\left(y.re \cdot y.re + y.im \cdot y.im\right)}^3}}}\]
      44.8
    4. Applied add-cbrt-cube to get
      \[\frac{\color{red}{x.re \cdot y.re + x.im \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.re \cdot y.re + x.im \cdot y.im\right)}^3}}}{\sqrt[3]{{\left(y.re \cdot y.re + y.im \cdot y.im\right)}^3}}\]
      52.8
    5. Applied cbrt-undiv to get
      \[\color{red}{\frac{\sqrt[3]{{\left(x.re \cdot y.re + x.im \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.re \cdot y.re + x.im \cdot y.im\right)}^3}{{\left(y.re \cdot y.re + y.im \cdot y.im\right)}^3}}}\]
      52.8
    6. Applied simplify to get
      \[\sqrt[3]{\color{red}{\frac{{\left(x.re \cdot y.re + x.im \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.re + y.im \cdot x.im}{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.re + y.im \cdot x.im}{y.im \cdot y.im + y.re \cdot y.re}\right)}^3} \leadsto \frac{x.re}{y.re}\]
      0
    8. Taylor expanded around 0 to get
      \[\color{red}{\frac{x.re}{y.re}} \leadsto \color{blue}{\frac{x.re}{y.re}}\]
      0
    9. Applied simplify to get
      \[\frac{x.re}{y.re} \leadsto \frac{x.re}{y.re}\]
      0

    10. Applied final simplification

    if -1.0880485702476334e+152 < y.re < 3.586178138959661e+58

    1. Started with
      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      18.1
    2. Using strategy rm
      18.1
    3. Applied clear-num to get
      \[\color{red}{\frac{x.re \cdot y.re + x.im \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.re \cdot y.re + x.im \cdot y.im}}}\]
      18.3
    4. Applied simplify to get
      \[\frac{1}{\color{red}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re \cdot y.re + x.im \cdot y.im}}} \leadsto \frac{1}{\color{blue}{\frac{{y.re}^2 + y.im \cdot y.im}{y.re \cdot x.re + x.im \cdot y.im}}}\]
      18.3

  1. Removed slow pow expressions

Original test:


(lambda ((x.re default) (x.im default) (y.re default) (y.im default))
  #:name "_divideComplex, real part"
  (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))