Average Error: 28.5 → 0.3
Time: 6.6s
Precision: 64
\[1.05367121277235087 \cdot 10^{-8} \lt a \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt b \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt c \lt 94906265.6242515594\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{1}{2} \cdot \frac{\frac{4 \cdot \left(a \cdot c\right)}{a}}{\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right) + \left(-b\right)\right) + \left(-\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{1}\right)}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{1}{2} \cdot \frac{\frac{4 \cdot \left(a \cdot c\right)}{a}}{\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right) + \left(-b\right)\right) + \left(-\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{1}\right)}
double f(double a, double b, double c) {
        double r44375 = b;
        double r44376 = -r44375;
        double r44377 = r44375 * r44375;
        double r44378 = 4.0;
        double r44379 = a;
        double r44380 = r44378 * r44379;
        double r44381 = c;
        double r44382 = r44380 * r44381;
        double r44383 = r44377 - r44382;
        double r44384 = sqrt(r44383);
        double r44385 = r44376 + r44384;
        double r44386 = 2.0;
        double r44387 = r44386 * r44379;
        double r44388 = r44385 / r44387;
        return r44388;
}

double f(double a, double b, double c) {
        double r44389 = 1.0;
        double r44390 = 2.0;
        double r44391 = r44389 / r44390;
        double r44392 = 4.0;
        double r44393 = a;
        double r44394 = c;
        double r44395 = r44393 * r44394;
        double r44396 = r44392 * r44395;
        double r44397 = r44396 / r44393;
        double r44398 = b;
        double r44399 = r44398 * r44398;
        double r44400 = r44392 * r44393;
        double r44401 = r44400 * r44394;
        double r44402 = r44399 - r44401;
        double r44403 = sqrt(r44402);
        double r44404 = sqrt(r44389);
        double r44405 = -r44404;
        double r44406 = r44405 + r44404;
        double r44407 = r44403 * r44406;
        double r44408 = -r44398;
        double r44409 = r44407 + r44408;
        double r44410 = r44403 * r44404;
        double r44411 = -r44410;
        double r44412 = r44409 + r44411;
        double r44413 = r44397 / r44412;
        double r44414 = r44391 * r44413;
        return r44414;
}

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

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

    \[\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 *-un-lft-identity0.4

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

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

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

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

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

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

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{1}\right) + \color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)}}}{2 \cdot a}\]
  13. Using strategy rm
  14. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\color{blue}{1 \cdot \left(\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{1}\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)\right)}}}{2 \cdot a}\]
  15. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \left(0 + 4 \cdot \left(a \cdot c\right)\right)}}{1 \cdot \left(\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{1}\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)\right)}}{2 \cdot a}\]
  16. Applied times-frac0.5

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{0 + 4 \cdot \left(a \cdot c\right)}{\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{1}\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)}}}{2 \cdot a}\]
  17. Applied times-frac0.5

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

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

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

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

Reproduce

herbie shell --seed 2020059 +o rules:numerics
(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)))