Average Error: 52.4 → 0.5
Time: 6.6s
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{4}{\frac{2}{a \cdot c}} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{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}{\frac{2}{a \cdot c}} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a}
double f(double a, double b, double c) {
        double r33284 = b;
        double r33285 = -r33284;
        double r33286 = r33284 * r33284;
        double r33287 = 4.0;
        double r33288 = a;
        double r33289 = r33287 * r33288;
        double r33290 = c;
        double r33291 = r33289 * r33290;
        double r33292 = r33286 - r33291;
        double r33293 = sqrt(r33292);
        double r33294 = r33285 + r33293;
        double r33295 = 2.0;
        double r33296 = r33295 * r33288;
        double r33297 = r33294 / r33296;
        return r33297;
}

double f(double a, double b, double c) {
        double r33298 = 4.0;
        double r33299 = 2.0;
        double r33300 = a;
        double r33301 = c;
        double r33302 = r33300 * r33301;
        double r33303 = r33299 / r33302;
        double r33304 = r33298 / r33303;
        double r33305 = 1.0;
        double r33306 = b;
        double r33307 = -r33306;
        double r33308 = r33306 * r33306;
        double r33309 = r33298 * r33300;
        double r33310 = r33309 * r33301;
        double r33311 = r33308 - r33310;
        double r33312 = sqrt(r33311);
        double r33313 = r33307 - r33312;
        double r33314 = r33305 / r33313;
        double r33315 = r33314 / r33300;
        double r33316 = r33304 * r33315;
        return r33316;
}

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

    \[\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.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 + 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. Using strategy rm
  6. Applied div-inv0.5

    \[\leadsto \frac{\color{blue}{\left(0 + 4 \cdot \left(a \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 + 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}}\]
  8. Simplified0.5

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

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

Reproduce

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