Average Error: 44.0 → 0.4
Time: 7.3s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{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}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{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}
double f(double a, double b, double c) {
        double r38570 = b;
        double r38571 = -r38570;
        double r38572 = r38570 * r38570;
        double r38573 = 4.0;
        double r38574 = a;
        double r38575 = r38573 * r38574;
        double r38576 = c;
        double r38577 = r38575 * r38576;
        double r38578 = r38572 - r38577;
        double r38579 = sqrt(r38578);
        double r38580 = r38571 + r38579;
        double r38581 = 2.0;
        double r38582 = r38581 * r38574;
        double r38583 = r38580 / r38582;
        return r38583;
}

double f(double a, double b, double c) {
        double r38584 = 0.0;
        double r38585 = 4.0;
        double r38586 = a;
        double r38587 = c;
        double r38588 = r38586 * r38587;
        double r38589 = r38585 * r38588;
        double r38590 = r38584 + r38589;
        double r38591 = b;
        double r38592 = -r38591;
        double r38593 = r38591 * r38591;
        double r38594 = r38585 * r38586;
        double r38595 = r38594 * r38587;
        double r38596 = r38593 - r38595;
        double r38597 = sqrt(r38596);
        double r38598 = r38592 - r38597;
        double r38599 = r38590 / r38598;
        double r38600 = 2.0;
        double r38601 = r38600 * r38586;
        double r38602 = r38599 / r38601;
        return r38602;
}

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 44.0

    \[\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-+44.0

    \[\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. Final simplification0.4

    \[\leadsto \frac{\frac{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}\]

Reproduce

herbie shell --seed 2019352 
(FPCore (a b c)
  :name "Quadratic roots, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e+15) (< 1.11022e-16 b 9.0072e+15) (< 1.11022e-16 c 9.0072e+15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))