\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
t_0 := \frac{\left(-b_2\right) + b_2}{a}\\
t_1 := \frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\
\mathbf{if}\;t_1 \leq -7.037395604649231 \cdot 10^{+132}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_1 \leq 3.0062298434955216 \cdot 10^{-32}:\\
\;\;\;\;\frac{\left(-b_2\right) + {\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.5}}{a}\\
\mathbf{else}:\\
\;\;\;\;t_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
(let* ((t_0 (/ (+ (- b_2) b_2) a))
(t_1 (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a)))
(if (<= t_1 -7.037395604649231e+132)
t_0
(if (<= t_1 3.0062298434955216e-32)
(/ (+ (- b_2) (pow (- (* b_2 b_2) (* c a)) 0.5)) a)
t_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 t_0 = (-b_2 + b_2) / a;
double t_1 = (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a;
double tmp;
if (t_1 <= -7.037395604649231e+132) {
tmp = t_0;
} else if (t_1 <= 3.0062298434955216e-32) {
tmp = (-b_2 + pow(((b_2 * b_2) - (c * a)), 0.5)) / a;
} else {
tmp = t_0;
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if (/.f64 (+.f64 (neg.f64 b_2) (sqrt.f64 (-.f64 (*.f64 b_2 b_2) (*.f64 a c)))) a) < -7.0373956046492312e132 or 3.00622984349552157e-32 < (/.f64 (+.f64 (neg.f64 b_2) (sqrt.f64 (-.f64 (*.f64 b_2 b_2) (*.f64 a c)))) a) Initial program 40.1
Taylor expanded in b_2 around inf 54.8
if -7.0373956046492312e132 < (/.f64 (+.f64 (neg.f64 b_2) (sqrt.f64 (-.f64 (*.f64 b_2 b_2) (*.f64 a c)))) a) < 3.00622984349552157e-32Initial program 24.9
Applied egg-rr43.4
Applied egg-rr43.4
Applied egg-rr24.9
Final simplification42.4
herbie shell --seed 2022127
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))