\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\begin{array}{l}
\mathbf{if}\;b \leq -1.3398860289927658 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{\frac{a \cdot 2}{-b}}\\
\mathbf{elif}\;b \leq 3.302437054159807 \cdot 10^{+102}:\\
\;\;\;\;\frac{\sqrt{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b} \cdot \frac{1}{a}}{\frac{2}{\sqrt{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}}}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
(FPCore (a b c)
:precision binary64
(if (<= b -1.3398860289927658e+154)
(/ 1.0 (/ (* a 2.0) (- b)))
(if (<= b 3.302437054159807e+102)
(/
(* (sqrt (- (sqrt (- (* b b) (* (* a 4.0) c))) b)) (/ 1.0 a))
(/ 2.0 (sqrt (- (sqrt (- (* b b) (* (* a 4.0) c))) b))))
0.0)))double code(double a, double b, double c) {
return (-b + sqrt((b * b) - ((4.0 * a) * c))) / (2.0 * a);
}
double code(double a, double b, double c) {
double tmp;
if (b <= -1.3398860289927658e+154) {
tmp = 1.0 / ((a * 2.0) / -b);
} else if (b <= 3.302437054159807e+102) {
tmp = (sqrt(sqrt((b * b) - ((a * 4.0) * c)) - b) * (1.0 / a)) / (2.0 / sqrt(sqrt((b * b) - ((a * 4.0) * c)) - b));
} else {
tmp = 0.0;
}
return tmp;
}



Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < -1.33988602899276581e154Initial program 64.0
Simplified64.0
rmApplied *-un-lft-identity_binary6464.0
Applied *-un-lft-identity_binary6464.0
Applied distribute-lft-out--_binary6464.0
Applied associate-/l*_binary6464.0
Taylor expanded around 0 52.3
if -1.33988602899276581e154 < b < 3.3024370541598071e102Initial program 19.8
Simplified19.8
rmApplied *-un-lft-identity_binary6419.8
Applied *-un-lft-identity_binary6419.8
Applied distribute-lft-out--_binary6419.8
Applied associate-/l*_binary6419.9
rmApplied add-sqr-sqrt_binary6420.3
Applied times-frac_binary6420.4
Applied associate-/r*_binary6420.4
Simplified20.4
if 3.3024370541598071e102 < b Initial program 60.1
Simplified60.1
Taylor expanded around 0 41.1
Final simplification28.7
herbie shell --seed 2020288
(FPCore (a b c)
:name "Quadratic roots, full range"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))