\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\frac{\sqrt{\frac{{\left({\left(\sqrt[3]{{\left(b \cdot b\right)}^{\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right)}} \cdot \left(\sqrt[3]{{\left(b \cdot b\right)}^{\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right)}} \cdot \sqrt[3]{{\left(b \cdot b\right)}^{\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right)}}\right)\right)}^{\left(\sqrt[3]{\sqrt[3]{3} \cdot \sqrt[3]{3}}\right)}\right)}^{\left(\sqrt[3]{\sqrt[3]{3}}\right)} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{b \cdot {b}^{3} + \left(\left(4 \cdot a\right) \cdot c\right) \cdot \left(b \cdot b + \left(4 \cdot a\right) \cdot c\right)}} - b}{a \cdot 2}(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
(FPCore (a b c)
:precision binary64
(/
(-
(sqrt
(/
(-
(pow
(pow
(*
(cbrt (pow (* b b) (* (cbrt 3.0) (cbrt 3.0))))
(*
(cbrt (pow (* b b) (* (cbrt 3.0) (cbrt 3.0))))
(cbrt (pow (* b b) (* (cbrt 3.0) (cbrt 3.0))))))
(cbrt (* (cbrt 3.0) (cbrt 3.0))))
(cbrt (cbrt 3.0)))
(pow (* (* 4.0 a) c) 3.0))
(+ (* b (pow b 3.0)) (* (* (* 4.0 a) c) (+ (* b b) (* (* 4.0 a) c))))))
b)
(* a 2.0)))double code(double a, double b, double c) {
return (-b + sqrt((b * b) - ((4.0 * a) * c))) / (2.0 * a);
}
double code(double a, double b, double c) {
return (sqrt((pow(pow((cbrt(pow((b * b), (cbrt(3.0) * cbrt(3.0)))) * (cbrt(pow((b * b), (cbrt(3.0) * cbrt(3.0)))) * cbrt(pow((b * b), (cbrt(3.0) * cbrt(3.0)))))), cbrt(cbrt(3.0) * cbrt(3.0))), cbrt(cbrt(3.0))) - pow(((4.0 * a) * c), 3.0)) / ((b * pow(b, 3.0)) + (((4.0 * a) * c) * ((b * b) + ((4.0 * a) * c))))) - b) / (a * 2.0);
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
Initial program 52.3
Simplified52.3
rmApplied flip3--_binary6452.3
Simplified52.0
rmApplied add-cube-cbrt_binary6452.0
Applied pow-unpow_binary6451.8
rmApplied add-cube-cbrt_binary6451.8
Applied cbrt-prod_binary6451.8
Applied pow-unpow_binary6451.2
rmApplied add-cube-cbrt_binary6451.2
Final simplification51.2
herbie shell --seed 2020268
(FPCore (a b c)
:name "Quadratic roots, wide range"
:precision binary64
:pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))