Average Error: 52.4 → 0.1
Time: 6.4s
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{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}
double f(double a, double b, double c) {
        double r34561 = b;
        double r34562 = -r34561;
        double r34563 = r34561 * r34561;
        double r34564 = 4.0;
        double r34565 = a;
        double r34566 = r34564 * r34565;
        double r34567 = c;
        double r34568 = r34566 * r34567;
        double r34569 = r34563 - r34568;
        double r34570 = sqrt(r34569);
        double r34571 = r34562 + r34570;
        double r34572 = 2.0;
        double r34573 = r34572 * r34565;
        double r34574 = r34571 / r34573;
        return r34574;
}

double f(double a, double b, double c) {
        double r34575 = 2.0;
        double r34576 = c;
        double r34577 = r34575 * r34576;
        double r34578 = b;
        double r34579 = -r34578;
        double r34580 = r34578 * r34578;
        double r34581 = 4.0;
        double r34582 = a;
        double r34583 = r34581 * r34582;
        double r34584 = r34583 * r34576;
        double r34585 = r34580 - r34584;
        double r34586 = sqrt(r34585);
        double r34587 = r34579 - r34586;
        double r34588 = r34577 / r34587;
        return r34588;
}

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{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}\]
  9. Applied associate-/l*0.5

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

    \[\leadsto \frac{\frac{1}{1}}{\color{blue}{\frac{2 \cdot a}{4 \cdot \left(a \cdot c\right)} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}\]
  11. Using strategy rm
  12. Applied associate-/r*0.3

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

    \[\leadsto \frac{\color{blue}{\frac{1}{2 \cdot a} \cdot \left(4 \cdot \left(a \cdot c\right)\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\]
  14. Taylor expanded around 0 0.1

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

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

Reproduce

herbie shell --seed 2019344 +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)))