(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 -7.5e+127)
(fma (/ b_2 a) -2.0 (* (/ 0.5 b_2) c))
(if (<= b_2 2.3e-42)
(/ (- b_2 (sqrt (- (* b_2 b_2) (* a c)))) (- a))
(/ (* c -0.5) b_2))))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 <= -7.5e+127) {
tmp = fma((b_2 / a), -2.0, ((0.5 / b_2) * c));
} else if (b_2 <= 2.3e-42) {
tmp = (b_2 - sqrt(((b_2 * b_2) - (a * c)))) / -a;
} else {
tmp = (c * -0.5) / b_2;
}
return tmp;
}
function code(a, b_2, c) return Float64(Float64(Float64(-b_2) + sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a) end
function code(a, b_2, c) tmp = 0.0 if (b_2 <= -7.5e+127) tmp = fma(Float64(b_2 / a), -2.0, Float64(Float64(0.5 / b_2) * c)); elseif (b_2 <= 2.3e-42) tmp = Float64(Float64(b_2 - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / Float64(-a)); else tmp = Float64(Float64(c * -0.5) / b_2); end return tmp end
code[a_, b$95$2_, c_] := N[(N[((-b$95$2) + N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -7.5e+127], N[(N[(b$95$2 / a), $MachinePrecision] * -2.0 + N[(N[(0.5 / b$95$2), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 2.3e-42], N[(N[(b$95$2 - N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / (-a)), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b$95$2), $MachinePrecision]]]
\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
\mathbf{if}\;b_2 \leq -7.5 \cdot 10^{+127}:\\
\;\;\;\;\mathsf{fma}\left(\frac{b_2}{a}, -2, \frac{0.5}{b_2} \cdot c\right)\\
\mathbf{elif}\;b_2 \leq 2.3 \cdot 10^{-42}:\\
\;\;\;\;\frac{b_2 - \sqrt{b_2 \cdot b_2 - a \cdot c}}{-a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b_2}\\
\end{array}



Bits error versus a



Bits error versus b_2



Bits error versus c
if b_2 < -7.4999999999999996e127Initial program 53.7
Simplified53.7
Applied egg-rr53.7
Taylor expanded in b_2 around -inf 3.1
Simplified3.1
if -7.4999999999999996e127 < b_2 < 2.30000000000000004e-42Initial program 13.4
Simplified13.4
Applied egg-rr13.5
Applied egg-rr13.4
if 2.30000000000000004e-42 < b_2 Initial program 54.0
Simplified54.0
Taylor expanded in b_2 around inf 7.8
Simplified7.8
Final simplification9.9
herbie shell --seed 2022152
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))