\[\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
Test:
The quadratic formula (r1)
Bits:
128 bits
Bits error versus a
Bits error versus b
Bits error versus c
Time: 14.7 s
Input Error: 33.6
Output Error: 29.2
Log:
Profile: 🕒
\(\frac{\frac{c}{1} \cdot \frac{4}{2}}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}\)
  1. Started with
    \[\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
    33.6
  2. Using strategy rm
    33.6
  3. Applied clear-num to get
    \[\color{red}{\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}} \leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}}\]
    33.7
  4. Using strategy rm
    33.7
  5. Applied flip-+ to get
    \[\frac{1}{\frac{2 \cdot a}{\color{red}{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}} \leadsto \frac{1}{\frac{2 \cdot a}{\color{blue}{\frac{{\left(-b\right)}^2 - {\left(\sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}\right)}^2}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}}}\]
    43.4
  6. Applied associate-/r/ to get
    \[\frac{1}{\color{red}{\frac{2 \cdot a}{\frac{{\left(-b\right)}^2 - {\left(\sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}\right)}^2}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}}} \leadsto \frac{1}{\color{blue}{\frac{2 \cdot a}{{\left(-b\right)}^2 - {\left(\sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}\right)}^2} \cdot \left(\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}\right)}}\]
    43.4
  7. Applied associate-/r* to get
    \[\color{red}{\frac{1}{\frac{2 \cdot a}{{\left(-b\right)}^2 - {\left(\sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}\right)}^2} \cdot \left(\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}\right)}} \leadsto \color{blue}{\frac{\frac{1}{\frac{2 \cdot a}{{\left(-b\right)}^2 - {\left(\sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}\right)}^2}}}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}\]
    43.4
  8. Applied simplify to get
    \[\frac{\color{red}{\frac{1}{\frac{2 \cdot a}{{\left(-b\right)}^2 - {\left(\sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}\right)}^2}}}}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}} \leadsto \frac{\color{blue}{\frac{c \cdot a}{a} \cdot \frac{4}{2}}}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}\]
    31.6
  9. Applied simplify to get
    \[\frac{\color{red}{\frac{c \cdot a}{a}} \cdot \frac{4}{2}}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}} \leadsto \frac{\color{blue}{\frac{c}{1}} \cdot \frac{4}{2}}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}\]
    29.2

Original test:


(lambda ((a default) (b default) (c default))
  #:name "The quadratic formula (r1)"
  (/ (+ (- b) (sqrt (- (sqr b) (* (* 4 a) c)))) (* 2 a))
  #:target
  (if (< b 0) (/ (+ (- b) (sqrt (- (sqr b) (* (* 4 a) c)))) (* 2 a)) (/ c (* a (/ (- (- b) (sqrt (- (sqr b) (* (* 4 a) c)))) (* 2 a))))))