\[\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: 20.1 s
Input Error: 33.4
Output Error: 29.7
Log:
Profile: 🕒
\({\left(\sqrt[3]{\frac{4 \cdot \frac{c}{2}}{\left(-b\right) - \sqrt{b \cdot b - \left(c \cdot 4\right) \cdot a}}}\right)}^3\)
  1. Started with
    \[\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
    33.4
  2. Using strategy rm
    33.4
  3. Applied flip-+ to get
    \[\frac{\color{red}{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a} \leadsto \frac{\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}}}}{2 \cdot a}\]
    43.3
  4. Applied simplify to get
    \[\frac{\frac{\color{red}{{\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}}}{2 \cdot a} \leadsto \frac{\frac{\color{blue}{\left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
    32.2
  5. Using strategy rm
    32.2
  6. Applied add-cube-cbrt to get
    \[\color{red}{\frac{\frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}} \leadsto \color{blue}{{\left(\sqrt[3]{\frac{\frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}}\right)}^3}\]
    32.6
  7. Applied simplify to get
    \[{\color{red}{\left(\sqrt[3]{\frac{\frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}}\right)}}^3 \leadsto {\color{blue}{\left(\sqrt[3]{\frac{\frac{c}{2} \cdot \left(1 \cdot 4\right)}{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}}\right)}}^3\]
    29.7
  8. Applied simplify to get
    \[{\left(\sqrt[3]{\color{red}{\frac{\frac{c}{2} \cdot \left(1 \cdot 4\right)}{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}}}\right)}^3 \leadsto {\left(\sqrt[3]{\color{blue}{\frac{4 \cdot \frac{c}{2}}{\left(-b\right) - \sqrt{b \cdot b - \left(c \cdot 4\right) \cdot a}}}}\right)}^3\]
    29.7

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