\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\begin{array}{l}
\mathbf{if}\;b \le -3.575938583654324 \cdot 10^{+94}:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a}{b} \cdot c - b\right)}\\
\mathbf{elif}\;b \le 4.0232110844075136 \cdot 10^{-262}:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}\\
\mathbf{elif}\;b \le 2.6656023684116586 \cdot 10^{+55}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-b}{a}\\
\end{array}double f(double a, double b, double c) {
double r2588382 = b;
double r2588383 = -r2588382;
double r2588384 = r2588382 * r2588382;
double r2588385 = 4.0;
double r2588386 = a;
double r2588387 = c;
double r2588388 = r2588386 * r2588387;
double r2588389 = r2588385 * r2588388;
double r2588390 = r2588384 - r2588389;
double r2588391 = sqrt(r2588390);
double r2588392 = r2588383 - r2588391;
double r2588393 = 2.0;
double r2588394 = r2588393 * r2588386;
double r2588395 = r2588392 / r2588394;
return r2588395;
}
double f(double a, double b, double c) {
double r2588396 = b;
double r2588397 = -3.575938583654324e+94;
bool r2588398 = r2588396 <= r2588397;
double r2588399 = 2.0;
double r2588400 = c;
double r2588401 = r2588399 * r2588400;
double r2588402 = a;
double r2588403 = r2588402 / r2588396;
double r2588404 = r2588403 * r2588400;
double r2588405 = r2588404 - r2588396;
double r2588406 = r2588399 * r2588405;
double r2588407 = r2588401 / r2588406;
double r2588408 = 4.0232110844075136e-262;
bool r2588409 = r2588396 <= r2588408;
double r2588410 = -r2588396;
double r2588411 = r2588396 * r2588396;
double r2588412 = 4.0;
double r2588413 = r2588402 * r2588400;
double r2588414 = r2588412 * r2588413;
double r2588415 = r2588411 - r2588414;
double r2588416 = sqrt(r2588415);
double r2588417 = r2588410 + r2588416;
double r2588418 = r2588401 / r2588417;
double r2588419 = 2.6656023684116586e+55;
bool r2588420 = r2588396 <= r2588419;
double r2588421 = 0.5;
double r2588422 = r2588410 - r2588416;
double r2588423 = r2588422 / r2588402;
double r2588424 = r2588421 * r2588423;
double r2588425 = r2588410 / r2588402;
double r2588426 = r2588420 ? r2588424 : r2588425;
double r2588427 = r2588409 ? r2588418 : r2588426;
double r2588428 = r2588398 ? r2588407 : r2588427;
return r2588428;
}




Bits error versus a




Bits error versus b




Bits error versus c
Results
| Original | 34.0 |
|---|---|
| Target | 21.3 |
| Herbie | 7.2 |
if b < -3.575938583654324e+94Initial program 58.9
rmApplied *-un-lft-identity58.9
Applied *-un-lft-identity58.9
Applied distribute-lft-out--58.9
Applied associate-/l*58.9
rmApplied flip--59.0
Applied associate-/r/59.0
Applied associate-/r*59.0
Simplified30.3
Taylor expanded around inf 29.6
Taylor expanded around -inf 6.4
Simplified2.5
if -3.575938583654324e+94 < b < 4.0232110844075136e-262Initial program 30.8
rmApplied *-un-lft-identity30.8
Applied *-un-lft-identity30.8
Applied distribute-lft-out--30.8
Applied associate-/l*30.8
rmApplied flip--31.0
Applied associate-/r/31.0
Applied associate-/r*31.0
Simplified16.1
Taylor expanded around inf 9.8
if 4.0232110844075136e-262 < b < 2.6656023684116586e+55Initial program 9.0
rmApplied *-un-lft-identity9.0
Applied *-un-lft-identity9.0
Applied distribute-lft-out--9.0
Applied associate-/l*9.2
rmApplied *-un-lft-identity9.2
Applied *-un-lft-identity9.2
Applied distribute-lft-out--9.2
Applied times-frac9.2
Applied *-un-lft-identity9.2
Applied times-frac9.2
Simplified9.2
Simplified9.0
if 2.6656023684116586e+55 < b Initial program 37.1
rmApplied *-un-lft-identity37.1
Applied *-un-lft-identity37.1
Applied distribute-lft-out--37.1
Applied associate-/l*37.2
Taylor expanded around 0 6.5
Simplified6.5
Final simplification7.2
herbie shell --seed 2019141
(FPCore (a b c)
:name "quadm (p42, negative)"
:herbie-target
(if (< b 0) (/ c (* a (/ (+ (- b) (sqrt (- (* b b) (* 4 (* a c))))) (* 2 a)))) (/ (- (- b) (sqrt (- (* b b) (* 4 (* a c))))) (* 2 a)))
(/ (- (- b) (sqrt (- (* b b) (* 4 (* a c))))) (* 2 a)))