Average Error: 52.2 → 0.4
Time: 20.2s
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{c \cdot \left(4 \cdot a\right)}{\left(a \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right) \cdot 2}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{c \cdot \left(4 \cdot a\right)}{\left(a \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right) \cdot 2}
double f(double a, double b, double c) {
        double r29234 = b;
        double r29235 = -r29234;
        double r29236 = r29234 * r29234;
        double r29237 = 4.0;
        double r29238 = a;
        double r29239 = r29237 * r29238;
        double r29240 = c;
        double r29241 = r29239 * r29240;
        double r29242 = r29236 - r29241;
        double r29243 = sqrt(r29242);
        double r29244 = r29235 + r29243;
        double r29245 = 2.0;
        double r29246 = r29245 * r29238;
        double r29247 = r29244 / r29246;
        return r29247;
}

double f(double a, double b, double c) {
        double r29248 = c;
        double r29249 = 4.0;
        double r29250 = a;
        double r29251 = r29249 * r29250;
        double r29252 = r29248 * r29251;
        double r29253 = b;
        double r29254 = -r29253;
        double r29255 = r29253 * r29253;
        double r29256 = r29251 * r29248;
        double r29257 = r29255 - r29256;
        double r29258 = sqrt(r29257);
        double r29259 = r29254 - r29258;
        double r29260 = r29250 * r29259;
        double r29261 = 2.0;
        double r29262 = r29260 * r29261;
        double r29263 = r29252 / r29262;
        return r29263;
}

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

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

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

    \[\leadsto \frac{\color{blue}{\left(0 + \left(4 \cdot a\right) \cdot c\right) \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  7. Applied associate-/l*0.5

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

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

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

Reproduce

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