Average Error: 52.5 → 0.5
Time: 7.0s
Precision: 64
\[4.93038 \cdot 10^{-32} \lt a \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt b \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt c \lt 2.02824 \cdot 10^{31}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{\frac{a}{4}} \cdot \left(\frac{1}{2} \cdot \left(a \cdot c\right)\right)\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{\frac{a}{4}} \cdot \left(\frac{1}{2} \cdot \left(a \cdot c\right)\right)
double f(double a, double b, double c) {
        double r36268 = b;
        double r36269 = -r36268;
        double r36270 = r36268 * r36268;
        double r36271 = 4.0;
        double r36272 = a;
        double r36273 = r36271 * r36272;
        double r36274 = c;
        double r36275 = r36273 * r36274;
        double r36276 = r36270 - r36275;
        double r36277 = sqrt(r36276);
        double r36278 = r36269 + r36277;
        double r36279 = 2.0;
        double r36280 = r36279 * r36272;
        double r36281 = r36278 / r36280;
        return r36281;
}

double f(double a, double b, double c) {
        double r36282 = 1.0;
        double r36283 = b;
        double r36284 = -r36283;
        double r36285 = r36283 * r36283;
        double r36286 = 4.0;
        double r36287 = a;
        double r36288 = r36286 * r36287;
        double r36289 = c;
        double r36290 = r36288 * r36289;
        double r36291 = r36285 - r36290;
        double r36292 = sqrt(r36291);
        double r36293 = r36284 - r36292;
        double r36294 = r36282 / r36293;
        double r36295 = r36287 / r36286;
        double r36296 = r36294 / r36295;
        double r36297 = 2.0;
        double r36298 = r36282 / r36297;
        double r36299 = r36287 * r36289;
        double r36300 = r36298 * r36299;
        double r36301 = r36296 * r36300;
        return r36301;
}

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.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-+52.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 flip-+0.4

    \[\leadsto \frac{\frac{\color{blue}{\frac{0 \cdot 0 - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)}{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}\]
  7. Applied associate-/l/0.5

    \[\leadsto \frac{\color{blue}{\frac{0 \cdot 0 - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)}{\left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot \left(0 - 4 \cdot \left(a \cdot c\right)\right)}}}{2 \cdot a}\]
  8. Using strategy rm
  9. Applied flip--0.5

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

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

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

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

    \[\leadsto \frac{\frac{0 \cdot 0 - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)}{\left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \cdot \left(0 \cdot 0 - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)\right)}}{\color{blue}{\frac{a}{4} \cdot \frac{2}{a \cdot c}}}\]
  14. Using strategy rm
  15. Applied *-un-lft-identity0.6

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

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

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

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

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

Reproduce

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