\[\frac{a \cdot c + b \cdot d}{{c}^2 + {d}^2}\]
Test:
Complex division, real part
Bits:
128 bits
Bits error versus a
Bits error versus b
Bits error versus c
Bits error versus d
Time: 12.2 s
Input Error: 27.7
Output Error: 10.5
Log:
Profile: 🕒
\(\begin{cases} (\left(\frac{b}{c}\right) * \left(\frac{d}{c}\right) + \left(\frac{a}{c}\right))_* & \text{when } c \le -4.8303687313024916 \cdot 10^{+55} \\ \frac{1}{\frac{(d * d + \left({c}^2\right))_*}{(c * a + \left(b \cdot d\right))_*}} & \text{when } c \le 8.340619114572883 \cdot 10^{+24} \\ (\left(\frac{b}{c}\right) * \left(\frac{d}{c}\right) + \left(\frac{a}{c}\right))_* & \text{otherwise} \end{cases}\)

    if c < -4.8303687313024916e+55 or 8.340619114572883e+24 < c

    1. Started with
      \[\frac{a \cdot c + b \cdot d}{{c}^2 + {d}^2}\]
      38.6
    2. Using strategy rm
      38.6
    3. Applied add-cube-cbrt to get
      \[\frac{a \cdot c + b \cdot d}{\color{red}{{c}^2 + {d}^2}} \leadsto \frac{a \cdot c + b \cdot d}{\color{blue}{{\left(\sqrt[3]{{c}^2 + {d}^2}\right)}^3}}\]
      38.8
    4. Applied taylor to get
      \[\frac{a \cdot c + b \cdot d}{{\left(\sqrt[3]{{c}^2 + {d}^2}\right)}^3} \leadsto \frac{a}{c} + \frac{b \cdot d}{{c}^2}\]
      10.5
    5. Taylor expanded around inf to get
      \[\color{red}{\frac{a}{c} + \frac{b \cdot d}{{c}^2}} \leadsto \color{blue}{\frac{a}{c} + \frac{b \cdot d}{{c}^2}}\]
      10.5
    6. Applied simplify to get
      \[\frac{a}{c} + \frac{b \cdot d}{{c}^2} \leadsto (\left(\frac{b}{c}\right) * \left(\frac{d}{c}\right) + \left(\frac{a}{c}\right))_*\]
      1.1

    7. Applied final simplification

    if -4.8303687313024916e+55 < c < 8.340619114572883e+24

    1. Started with
      \[\frac{a \cdot c + b \cdot d}{{c}^2 + {d}^2}\]
      18.4
    2. Using strategy rm
      18.4
    3. Applied clear-num to get
      \[\color{red}{\frac{a \cdot c + b \cdot d}{{c}^2 + {d}^2}} \leadsto \color{blue}{\frac{1}{\frac{{c}^2 + {d}^2}{a \cdot c + b \cdot d}}}\]
      18.6
    4. Applied simplify to get
      \[\frac{1}{\color{red}{\frac{{c}^2 + {d}^2}{a \cdot c + b \cdot d}}} \leadsto \frac{1}{\color{blue}{\frac{(d * d + \left({c}^2\right))_*}{(c * a + \left(b \cdot d\right))_*}}}\]
      18.6

  1. Removed slow pow expressions

Original test:


(lambda ((a default) (b default) (c default) (d default))
  #:name "Complex division, real part"
  (/ (+ (* a c) (* b d)) (+ (sqr c) (sqr d)))
  #:target
  (if (< (fabs d) (fabs c)) (/ (+ a (* b (/ d c))) (+ c (* d (/ d c)))) (/ (+ b (* a (/ c d))) (+ d (* c (/ c d))))))