\[\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: 16.0 s
Input Error: 25.7
Output Error: 25.7
Log:
Profile: 🕒
\(\frac{(d * b + \left(c \cdot a\right))_*}{(d * d + \left(c \cdot c\right))_*}\)
  1. Started with
    \[\frac{a \cdot c + b \cdot d}{{c}^2 + {d}^2}\]
    25.7
  2. Using strategy rm
    25.7
  3. Applied flip-+ to get
    \[\frac{\color{red}{a \cdot c + b \cdot d}}{{c}^2 + {d}^2} \leadsto \frac{\color{blue}{\frac{{\left(a \cdot c\right)}^2 - {\left(b \cdot d\right)}^2}{a \cdot c - b \cdot d}}}{{c}^2 + {d}^2}\]
    37.7
  4. Applied associate-/l/ to get
    \[\color{red}{\frac{\frac{{\left(a \cdot c\right)}^2 - {\left(b \cdot d\right)}^2}{a \cdot c - b \cdot d}}{{c}^2 + {d}^2}} \leadsto \color{blue}{\frac{{\left(a \cdot c\right)}^2 - {\left(b \cdot d\right)}^2}{\left({c}^2 + {d}^2\right) \cdot \left(a \cdot c - b \cdot d\right)}}\]
    40.3
  5. Applied taylor to get
    \[\frac{{\left(a \cdot c\right)}^2 - {\left(b \cdot d\right)}^2}{\left({c}^2 + {d}^2\right) \cdot \left(a \cdot c - b \cdot d\right)} \leadsto \frac{{\left(a \cdot c\right)}^2 - {\left(b \cdot d\right)}^2}{\left({c}^2 + {d}^2\right) \cdot \left(c \cdot a - b \cdot d\right)}\]
    40.3
  6. Taylor expanded around inf to get
    \[\frac{{\left(a \cdot c\right)}^2 - {\left(b \cdot d\right)}^2}{\left({c}^2 + {d}^2\right) \cdot \color{red}{\left(c \cdot a - b \cdot d\right)}} \leadsto \frac{{\left(a \cdot c\right)}^2 - {\left(b \cdot d\right)}^2}{\left({c}^2 + {d}^2\right) \cdot \color{blue}{\left(c \cdot a - b \cdot d\right)}}\]
    40.3
  7. Applied simplify to get
    \[\frac{{\left(a \cdot c\right)}^2 - {\left(b \cdot d\right)}^2}{\left({c}^2 + {d}^2\right) \cdot \left(c \cdot a - b \cdot d\right)} \leadsto \frac{(d * b + \left(c \cdot a\right))_*}{\frac{(d * d + \left(c \cdot c\right))_*}{1}}\]
    25.7

  8. Applied final simplification
  9. Applied simplify to get
    \[\color{red}{\frac{(d * b + \left(c \cdot a\right))_*}{\frac{(d * d + \left(c \cdot c\right))_*}{1}}} \leadsto \color{blue}{\frac{(d * b + \left(c \cdot a\right))_*}{(d * d + \left(c \cdot c\right))_*}}\]
    25.7

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