Average Error: 43.3 → 0.5
Time: 16.7s
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{4 \cdot \left(a \cdot c\right)}{2} \cdot \frac{\frac{1}{\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}}}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{4 \cdot \left(a \cdot c\right)}{2} \cdot \frac{\frac{1}{\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}}}}{a}
double f(double a, double b, double c) {
        double r47072 = b;
        double r47073 = -r47072;
        double r47074 = r47072 * r47072;
        double r47075 = 4.0;
        double r47076 = a;
        double r47077 = r47075 * r47076;
        double r47078 = c;
        double r47079 = r47077 * r47078;
        double r47080 = r47074 - r47079;
        double r47081 = sqrt(r47080);
        double r47082 = r47073 + r47081;
        double r47083 = 2.0;
        double r47084 = r47083 * r47076;
        double r47085 = r47082 / r47084;
        return r47085;
}

double f(double a, double b, double c) {
        double r47086 = 4.0;
        double r47087 = a;
        double r47088 = c;
        double r47089 = r47087 * r47088;
        double r47090 = r47086 * r47089;
        double r47091 = 2.0;
        double r47092 = r47090 / r47091;
        double r47093 = 1.0;
        double r47094 = b;
        double r47095 = -r47094;
        double r47096 = 4.0;
        double r47097 = pow(r47094, r47096);
        double r47098 = r47086 * r47087;
        double r47099 = r47098 * r47088;
        double r47100 = r47099 * r47099;
        double r47101 = r47097 - r47100;
        double r47102 = r47094 * r47094;
        double r47103 = r47102 + r47099;
        double r47104 = r47101 / r47103;
        double r47105 = sqrt(r47104);
        double r47106 = r47095 - r47105;
        double r47107 = r47093 / r47106;
        double r47108 = r47107 / r47087;
        double r47109 = r47092 * r47108;
        return r47109;
}

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 43.3

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

    \[\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 + a \cdot \left(4 \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 \frac{\color{blue}{\left(0 + a \cdot \left(4 \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 + a \cdot \left(4 \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 \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}\]
  9. Using strategy rm
  10. Applied flip--0.5

    \[\leadsto \frac{4 \cdot \left(a \cdot c\right)}{2} \cdot \frac{\frac{1}{\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}}}}}{a}\]
  11. Simplified0.5

    \[\leadsto \frac{4 \cdot \left(a \cdot c\right)}{2} \cdot \frac{\frac{1}{\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}}}}{a}\]
  12. Final simplification0.5

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

Reproduce

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