Average Error: 52.7 → 0.4
Time: 18.5s
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{1}{2 \cdot a} \cdot \frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{1}{2 \cdot a} \cdot \frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}
double f(double a, double b, double c) {
        double r29684 = b;
        double r29685 = -r29684;
        double r29686 = r29684 * r29684;
        double r29687 = 4.0;
        double r29688 = a;
        double r29689 = r29687 * r29688;
        double r29690 = c;
        double r29691 = r29689 * r29690;
        double r29692 = r29686 - r29691;
        double r29693 = sqrt(r29692);
        double r29694 = r29685 + r29693;
        double r29695 = 2.0;
        double r29696 = r29695 * r29688;
        double r29697 = r29694 / r29696;
        return r29697;
}

double f(double a, double b, double c) {
        double r29698 = 1.0;
        double r29699 = 2.0;
        double r29700 = a;
        double r29701 = r29699 * r29700;
        double r29702 = r29698 / r29701;
        double r29703 = 4.0;
        double r29704 = r29703 * r29700;
        double r29705 = c;
        double r29706 = r29704 * r29705;
        double r29707 = b;
        double r29708 = -r29707;
        double r29709 = r29707 * r29707;
        double r29710 = r29709 - r29706;
        double r29711 = sqrt(r29710);
        double r29712 = r29708 - r29711;
        double r29713 = r29706 / r29712;
        double r29714 = r29702 * r29713;
        return r29714;
}

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

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

    \[\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 + \left(4 \cdot a\right) \cdot c}}{\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 + \left(4 \cdot a\right) \cdot c}{\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{1}{2 \cdot a} \cdot \frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\]

Reproduce

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