Average Error: 28.3 → 0.4
Time: 6.0s
Precision: 64
\[1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt a \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt b \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt c \lt 94906265.62425155937671661376953125\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(2 \cdot a\right) \cdot \left(-b\right) + \left(2 \cdot a\right) \cdot \left(-\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(2 \cdot a\right) \cdot \left(-b\right) + \left(2 \cdot a\right) \cdot \left(-\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}
double f(double a, double b, double c) {
        double r34340 = b;
        double r34341 = -r34340;
        double r34342 = r34340 * r34340;
        double r34343 = 4.0;
        double r34344 = a;
        double r34345 = r34343 * r34344;
        double r34346 = c;
        double r34347 = r34345 * r34346;
        double r34348 = r34342 - r34347;
        double r34349 = sqrt(r34348);
        double r34350 = r34341 + r34349;
        double r34351 = 2.0;
        double r34352 = r34351 * r34344;
        double r34353 = r34350 / r34352;
        return r34353;
}

double f(double a, double b, double c) {
        double r34354 = 0.0;
        double r34355 = 4.0;
        double r34356 = a;
        double r34357 = c;
        double r34358 = r34356 * r34357;
        double r34359 = r34355 * r34358;
        double r34360 = r34354 + r34359;
        double r34361 = 2.0;
        double r34362 = r34361 * r34356;
        double r34363 = b;
        double r34364 = -r34363;
        double r34365 = r34362 * r34364;
        double r34366 = r34363 * r34363;
        double r34367 = r34355 * r34356;
        double r34368 = r34367 * r34357;
        double r34369 = r34366 - r34368;
        double r34370 = sqrt(r34369);
        double r34371 = -r34370;
        double r34372 = r34362 * r34371;
        double r34373 = r34365 + r34372;
        double r34374 = r34360 / r34373;
        return r34374;
}

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 28.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-+28.3

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

    \[\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 associate-/l*0.5

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

    \[\leadsto \frac{0 + 4 \cdot \left(a \cdot c\right)}{\color{blue}{\left(2 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}\]
  9. Using strategy rm
  10. Applied sub-neg0.5

    \[\leadsto \frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(2 \cdot a\right) \cdot \color{blue}{\left(\left(-b\right) + \left(-\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right)}}\]
  11. Applied distribute-lft-in0.4

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

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

Reproduce

herbie shell --seed 2019352 
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))