\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.3646970996418853 \cdot 10^{+154}:\\
\;\;\;\;\left(\sqrt{0} - b_2\right) \cdot \frac{1}{a}\\
\mathbf{elif}\;b_2 \leq -1.3415086610309752 \cdot 10^{-272}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\
\mathbf{elif}\;b_2 \leq 1.3503059635204164 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{0 \cdot \left(b_2 \cdot b_2\right) - a \cdot c}{b_2 + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}(FPCore (a b_2 c) :precision binary64 (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
(FPCore (a b_2 c)
:precision binary64
(if (<= b_2 -1.3646970996418853e+154)
(* (- (sqrt 0.0) b_2) (/ 1.0 a))
(if (<= b_2 -1.3415086610309752e-272)
(/ (- (sqrt (- (* b_2 b_2) (* a c))) b_2) a)
(if (<= b_2 1.3503059635204164e+154)
(/
(/
(- (* 0.0 (* b_2 b_2)) (* a c))
(+ b_2 (sqrt (- (* b_2 b_2) (* a c)))))
a)
0.0))))double code(double a, double b_2, double c) {
return (-b_2 + sqrt((b_2 * b_2) - (a * c))) / a;
}
double code(double a, double b_2, double c) {
double tmp;
if (b_2 <= -1.3646970996418853e+154) {
tmp = (sqrt(0.0) - b_2) * (1.0 / a);
} else if (b_2 <= -1.3415086610309752e-272) {
tmp = (sqrt((b_2 * b_2) - (a * c)) - b_2) / a;
} else if (b_2 <= 1.3503059635204164e+154) {
tmp = (((0.0 * (b_2 * b_2)) - (a * c)) / (b_2 + sqrt((b_2 * b_2) - (a * c)))) / a;
} else {
tmp = 0.0;
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -1.3646970996418853e154Initial program 64.0
Simplified64.0
rmApplied div-inv_binary6464.0
Taylor expanded around 0 52.2
if -1.3646970996418853e154 < b_2 < -1.34150866103097518e-272Initial program 8.6
Simplified8.6
if -1.34150866103097518e-272 < b_2 < 1.35030596352041636e154Initial program 33.8
Simplified33.8
rmApplied flip--_binary6433.9
Simplified16.2
Simplified16.2
if 1.35030596352041636e154 < b_2 Initial program 64.0
Simplified64.0
Taylor expanded around 0 36.6
Final simplification21.4
herbie shell --seed 2020285
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))