Average Error: 52.6 → 0.5
Time: 25.5s
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{4}{\frac{2}{a \cdot c}} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{4}{\frac{2}{a \cdot c}} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a}
double f(double a, double b, double c) {
        double r118530 = b;
        double r118531 = -r118530;
        double r118532 = r118530 * r118530;
        double r118533 = 4.0;
        double r118534 = a;
        double r118535 = r118533 * r118534;
        double r118536 = c;
        double r118537 = r118535 * r118536;
        double r118538 = r118532 - r118537;
        double r118539 = sqrt(r118538);
        double r118540 = r118531 + r118539;
        double r118541 = 2.0;
        double r118542 = r118541 * r118534;
        double r118543 = r118540 / r118542;
        return r118543;
}

double f(double a, double b, double c) {
        double r118544 = 4.0;
        double r118545 = 2.0;
        double r118546 = a;
        double r118547 = c;
        double r118548 = r118546 * r118547;
        double r118549 = r118545 / r118548;
        double r118550 = r118544 / r118549;
        double r118551 = 1.0;
        double r118552 = b;
        double r118553 = -r118552;
        double r118554 = r118552 * r118552;
        double r118555 = r118544 * r118546;
        double r118556 = r118555 * r118547;
        double r118557 = r118554 - r118556;
        double r118558 = sqrt(r118557);
        double r118559 = r118553 - r118558;
        double r118560 = r118551 / r118559;
        double r118561 = r118560 / r118546;
        double r118562 = r118550 * r118561;
        return r118562;
}

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 \frac{\color{blue}{\left(0 + 4 \cdot \left(a \cdot c\right)\right) \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  7. Applied times-frac0.5

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

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

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

Reproduce

herbie shell --seed 2020027 
(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)))