Average Error: 44.1 → 0.4
Time: 19.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{c \cdot \left(4 \cdot a\right)}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(\left(4 \cdot a\right) \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot c\right)}{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{c \cdot \left(4 \cdot a\right)}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(\left(4 \cdot a\right) \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot c\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}
double f(double a, double b, double c) {
        double r37853 = b;
        double r37854 = -r37853;
        double r37855 = r37853 * r37853;
        double r37856 = 4.0;
        double r37857 = a;
        double r37858 = r37856 * r37857;
        double r37859 = c;
        double r37860 = r37858 * r37859;
        double r37861 = r37855 - r37860;
        double r37862 = sqrt(r37861);
        double r37863 = r37854 + r37862;
        double r37864 = 2.0;
        double r37865 = r37864 * r37857;
        double r37866 = r37863 / r37865;
        return r37866;
}

double f(double a, double b, double c) {
        double r37867 = c;
        double r37868 = 4.0;
        double r37869 = a;
        double r37870 = r37868 * r37869;
        double r37871 = r37867 * r37870;
        double r37872 = b;
        double r37873 = -r37872;
        double r37874 = 4.0;
        double r37875 = pow(r37872, r37874);
        double r37876 = r37870 * r37867;
        double r37877 = r37876 * r37876;
        double r37878 = r37875 - r37877;
        double r37879 = r37872 * r37872;
        double r37880 = r37879 + r37876;
        double r37881 = r37878 / r37880;
        double r37882 = sqrt(r37881);
        double r37883 = r37873 - r37882;
        double r37884 = r37871 / r37883;
        double r37885 = 2.0;
        double r37886 = r37885 * r37869;
        double r37887 = r37884 / r37886;
        return r37887;
}

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

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

    \[\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 flip--0.4

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

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

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

Reproduce

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