Average Error: 52.6 → 0.4
Time: 7.0s
Precision: 64
\[4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt a \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt b \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt c \lt 20282409603651670423947251286016\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}} \cdot \frac{1}{2 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}} \cdot \frac{1}{2 \cdot a}
double f(double a, double b, double c) {
        double r38523 = b;
        double r38524 = -r38523;
        double r38525 = r38523 * r38523;
        double r38526 = 4.0;
        double r38527 = a;
        double r38528 = r38526 * r38527;
        double r38529 = c;
        double r38530 = r38528 * r38529;
        double r38531 = r38525 - r38530;
        double r38532 = sqrt(r38531);
        double r38533 = r38524 + r38532;
        double r38534 = 2.0;
        double r38535 = r38534 * r38527;
        double r38536 = r38533 / r38535;
        return r38536;
}

double f(double a, double b, double c) {
        double r38537 = 0.0;
        double r38538 = 4.0;
        double r38539 = a;
        double r38540 = c;
        double r38541 = r38539 * r38540;
        double r38542 = r38538 * r38541;
        double r38543 = r38537 + r38542;
        double r38544 = b;
        double r38545 = -r38544;
        double r38546 = r38544 * r38544;
        double r38547 = r38538 * r38539;
        double r38548 = r38547 * r38540;
        double r38549 = r38546 - r38548;
        double r38550 = sqrt(r38549);
        double r38551 = r38545 - r38550;
        double r38552 = r38543 / r38551;
        double r38553 = 1.0;
        double r38554 = 2.0;
        double r38555 = r38554 * r38539;
        double r38556 = r38553 / r38555;
        double r38557 = r38552 * r38556;
        return r38557;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 52.6

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
  2. Using strategy rm
  3. Applied flip-+52.6

    \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  4. Simplified0.4

    \[\leadsto \frac{\frac{\color{blue}{0 + 4 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
  5. Using strategy rm
  6. Applied div-inv0.4

    \[\leadsto \color{blue}{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}} \cdot \frac{1}{2 \cdot a}}\]
  7. Final simplification0.4

    \[\leadsto \frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}} \cdot \frac{1}{2 \cdot a}\]

Reproduce

herbie shell --seed 2019356 +o rules:numerics
(FPCore (a b c)
  :name "Quadratic roots, wide range"
  :precision binary64
  :pre (and (< 4.9303800000000003e-32 a 2.02824e+31) (< 4.9303800000000003e-32 b 2.02824e+31) (< 4.9303800000000003e-32 c 2.02824e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))