\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\begin{array}{l}
\mathbf{if}\;b \le -4.137767488706158662875767200280605724187 \cdot 10^{113}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.6666666666666666296592325124947819858789 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \le -2.09566795091098069769904337484991989359 \cdot 10^{-241}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\
\mathbf{elif}\;b \le 0.01064842317658122247681085070780682144687:\\
\;\;\;\;\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}double f(double a, double b, double c) {
double r94673 = b;
double r94674 = -r94673;
double r94675 = r94673 * r94673;
double r94676 = 3.0;
double r94677 = a;
double r94678 = r94676 * r94677;
double r94679 = c;
double r94680 = r94678 * r94679;
double r94681 = r94675 - r94680;
double r94682 = sqrt(r94681);
double r94683 = r94674 + r94682;
double r94684 = r94683 / r94678;
return r94684;
}
double f(double a, double b, double c) {
double r94685 = b;
double r94686 = -4.137767488706159e+113;
bool r94687 = r94685 <= r94686;
double r94688 = 0.5;
double r94689 = c;
double r94690 = r94689 / r94685;
double r94691 = r94688 * r94690;
double r94692 = 0.6666666666666666;
double r94693 = a;
double r94694 = r94685 / r94693;
double r94695 = r94692 * r94694;
double r94696 = r94691 - r94695;
double r94697 = -2.0956679509109807e-241;
bool r94698 = r94685 <= r94697;
double r94699 = -r94685;
double r94700 = r94685 * r94685;
double r94701 = 3.0;
double r94702 = r94701 * r94693;
double r94703 = r94702 * r94689;
double r94704 = r94700 - r94703;
double r94705 = sqrt(r94704);
double r94706 = r94699 + r94705;
double r94707 = r94706 / r94702;
double r94708 = 0.010648423176581222;
bool r94709 = r94685 <= r94708;
double r94710 = r94699 - r94705;
double r94711 = r94689 / r94710;
double r94712 = -0.5;
double r94713 = r94712 * r94690;
double r94714 = r94709 ? r94711 : r94713;
double r94715 = r94698 ? r94707 : r94714;
double r94716 = r94687 ? r94696 : r94715;
return r94716;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -4.137767488706159e+113Initial program 50.4
Taylor expanded around -inf 3.7
if -4.137767488706159e+113 < b < -2.0956679509109807e-241Initial program 7.6
if -2.0956679509109807e-241 < b < 0.010648423176581222Initial program 23.8
rmApplied flip-+23.9
Simplified17.8
rmApplied div-inv17.9
rmApplied associate-*r/17.8
Simplified17.8
rmApplied *-un-lft-identity17.8
Applied times-frac14.9
Applied associate-/l*11.3
Simplified11.2
if 0.010648423176581222 < b Initial program 55.6
Taylor expanded around inf 6.1
Final simplification7.4
herbie shell --seed 2019305
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))