\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}-\frac{c \cdot \frac{4}{b + \sqrt{\mathsf{fma}\left(a \cdot c, -4, {b}^{2}\right)}}}{2}double f(double a, double b, double c) {
double r37336 = b;
double r37337 = -r37336;
double r37338 = r37336 * r37336;
double r37339 = 4.0;
double r37340 = a;
double r37341 = r37339 * r37340;
double r37342 = c;
double r37343 = r37341 * r37342;
double r37344 = r37338 - r37343;
double r37345 = sqrt(r37344);
double r37346 = r37337 + r37345;
double r37347 = 2.0;
double r37348 = r37347 * r37340;
double r37349 = r37346 / r37348;
return r37349;
}
double f(double a, double b, double c) {
double r37350 = c;
double r37351 = 4.0;
double r37352 = b;
double r37353 = a;
double r37354 = r37353 * r37350;
double r37355 = -r37351;
double r37356 = 2.0;
double r37357 = pow(r37352, r37356);
double r37358 = fma(r37354, r37355, r37357);
double r37359 = sqrt(r37358);
double r37360 = r37352 + r37359;
double r37361 = r37351 / r37360;
double r37362 = r37350 * r37361;
double r37363 = 2.0;
double r37364 = r37362 / r37363;
double r37365 = -r37364;
return r37365;
}



Bits error versus a



Bits error versus b



Bits error versus c
Initial program 52.4
Simplified52.4
rmApplied flip--52.4
Simplified0.4
Simplified0.4
rmApplied *-un-lft-identity0.4
Applied *-un-lft-identity0.4
Applied *-un-lft-identity0.4
Applied times-frac0.4
Applied times-frac0.4
Simplified0.4
Simplified0.4
rmApplied associate-/r*0.2
Simplified0.1
rmApplied *-un-lft-identity0.1
Applied add-cube-cbrt0.1
Applied distribute-lft-neg-in0.1
Applied times-frac0.1
Applied times-frac0.3
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019194 +o rules:numerics
(FPCore (a b c)
:name "Quadratic roots, wide range"
:pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))