\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\begin{array}{l}
t_0 := \frac{c}{b} \cdot -0.5\\
\mathbf{if}\;b \leq -7.129467328473503 \cdot 10^{+79}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} - 0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{elif}\;b \leq 2.3252761482698304 \cdot 10^{-132}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 4.629430298105775 \cdot 10^{-102}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;b \leq 1.1474036072114028 \cdot 10^{-45}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}}{a \cdot 3} - \frac{b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\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
(let* ((t_0 (* (/ c b) -0.5)))
(if (<= b -7.129467328473503e+79)
(- (* 0.5 (/ c b)) (* 0.6666666666666666 (/ b a)))
(if (<= b 2.3252761482698304e-132)
(/ (- (sqrt (fma c (* a -3.0) (* b b))) b) (* a 3.0))
(if (<= b 4.629430298105775e-102)
t_0
(if (<= b 1.1474036072114028e-45)
(- (/ (sqrt (fma a (* c -3.0) (* b b))) (* a 3.0)) (/ b (* a 3.0)))
t_0))))))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 t_0 = (c / b) * -0.5;
double tmp;
if (b <= -7.129467328473503e+79) {
tmp = (0.5 * (c / b)) - (0.6666666666666666 * (b / a));
} else if (b <= 2.3252761482698304e-132) {
tmp = (sqrt(fma(c, (a * -3.0), (b * b))) - b) / (a * 3.0);
} else if (b <= 4.629430298105775e-102) {
tmp = t_0;
} else if (b <= 1.1474036072114028e-45) {
tmp = (sqrt(fma(a, (c * -3.0), (b * b))) / (a * 3.0)) - (b / (a * 3.0));
} else {
tmp = t_0;
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
if b < -7.1294673284735029e79Initial program 43.8
Simplified43.9
Taylor expanded in b around -inf 5.6
if -7.1294673284735029e79 < b < 2.3252761482698304e-132Initial program 11.4
Applied egg-rr11.4
if 2.3252761482698304e-132 < b < 4.62943029810577516e-102 or 1.14740360721140278e-45 < b Initial program 52.3
Simplified52.3
Taylor expanded in a around 0 9.2
if 4.62943029810577516e-102 < b < 1.14740360721140278e-45Initial program 36.2
Simplified36.2
Applied egg-rr36.2
Applied egg-rr36.2
Final simplification10.6
herbie shell --seed 2022130
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))