Average Error: 52.6 → 0.5
Time: 6.2s
Precision: 64
\[4.93038 \cdot 10^{-32} \lt a \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt b \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt c \lt 2.02824 \cdot 10^{31}\]
\[\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 r41595 = b;
        double r41596 = -r41595;
        double r41597 = r41595 * r41595;
        double r41598 = 4.0;
        double r41599 = a;
        double r41600 = r41598 * r41599;
        double r41601 = c;
        double r41602 = r41600 * r41601;
        double r41603 = r41597 - r41602;
        double r41604 = sqrt(r41603);
        double r41605 = r41596 + r41604;
        double r41606 = 2.0;
        double r41607 = r41606 * r41599;
        double r41608 = r41605 / r41607;
        return r41608;
}

double f(double a, double b, double c) {
        double r41609 = 0.0;
        double r41610 = 4.0;
        double r41611 = a;
        double r41612 = c;
        double r41613 = r41611 * r41612;
        double r41614 = r41610 * r41613;
        double r41615 = r41609 + r41614;
        double r41616 = b;
        double r41617 = -r41616;
        double r41618 = r41616 * r41616;
        double r41619 = r41610 * r41611;
        double r41620 = r41619 * r41612;
        double r41621 = r41618 - r41620;
        double r41622 = sqrt(r41621);
        double r41623 = r41617 - r41622;
        double r41624 = r41615 / r41623;
        double r41625 = 1.0;
        double r41626 = 2.0;
        double r41627 = r41626 * r41611;
        double r41628 = r41625 / r41627;
        double r41629 = r41624 * r41628;
        return r41629;
}

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.5

    \[\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.5

    \[\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 2020025 
(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)))