\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\begin{array}{l}
\mathbf{if}\;b \leq -6.065682558106337 \cdot 10^{+71}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{b}{a} \cdot -0.6666666666666666\right)\\
\mathbf{elif}\;b \leq 0.0530714506824282:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
(FPCore (a b c)
:precision binary64
(if (<= b -6.065682558106337e+71)
(fma 0.5 (/ c b) (* (/ b a) -0.6666666666666666))
(if (<= b 0.0530714506824282)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(* (/ c b) -0.5))))double code(double a, double b, double c) {
return (-b + sqrt((b * b) - ((3.0 * a) * c))) / (3.0 * a);
}
double code(double a, double b, double c) {
double tmp;
if (b <= -6.065682558106337e+71) {
tmp = fma(0.5, (c / b), ((b / a) * -0.6666666666666666));
} else if (b <= 0.0530714506824282) {
tmp = (sqrt((b * b) - (c * (a * 3.0))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
if b < -6.0656825581063369e71Initial program 41.2
Taylor expanded in b around 0 41.2
Simplified41.2
Taylor expanded in b around -inf 5.5
Simplified5.5
if -6.0656825581063369e71 < b < 0.053071450682428203Initial program 16.8
Applied *-un-lft-identity_binary6416.8
if 0.053071450682428203 < b Initial program 55.0
Taylor expanded in b around 0 55.0
Simplified55.0
Taylor expanded in b around inf 6.3
Final simplification11.2
herbie shell --seed 2022094
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))