\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.3308472529742322 \cdot 10^{+154}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{b_2 \cdot b_2}} - b_2}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{1}{\sqrt[3]{a}}\\
\mathbf{elif}\;b_2 \leq 1.9966424328827729 \cdot 10^{-38}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b_2}\\
\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.3308472529742322e+154)
(*
(/ (- (sqrt (/ 1.0 (* b_2 b_2))) b_2) (* (cbrt a) (cbrt a)))
(/ 1.0 (cbrt a)))
(if (<= b_2 1.9966424328827729e-38)
(/ (- (sqrt (- (* b_2 b_2) (* a c))) b_2) a)
(* -0.5 (/ c 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 <= -1.3308472529742322e+154) {
tmp = ((sqrt(1.0 / (b_2 * b_2)) - b_2) / (cbrt(a) * cbrt(a))) * (1.0 / cbrt(a));
} else if (b_2 <= 1.9966424328827729e-38) {
tmp = (sqrt((b_2 * b_2) - (a * c)) - b_2) / a;
} else {
tmp = -0.5 * (c / b_2);
}
return tmp;
}



Bits error versus a



Bits error versus b_2



Bits error versus c
Results
if b_2 < -1.3308472529742322e154Initial program 64.0
Simplified64.0
rmApplied div-inv_binary6464.0
rmApplied add-cube-cbrt_binary6464.0
Applied *-un-lft-identity_binary6464.0
Applied times-frac_binary6464.0
Applied associate-*r*_binary6464.0
Simplified64.0
Taylor expanded around inf 52.2
Simplified52.2
if -1.3308472529742322e154 < b_2 < 1.99664243288277287e-38Initial program 13.9
if 1.99664243288277287e-38 < b_2 Initial program 54.9
Simplified54.9
Taylor expanded around 0 7.4
Final simplification16.2
herbie shell --seed 2020344
(FPCore (a b_2 c)
:name "quad2p (problem 3.2.1, positive)"
:precision binary64
(/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))