Average Error: 52.4 → 0.1
Time: 19.1s
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{1}{2} \cdot \frac{c}{\frac{\left(-b\right) - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{4}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{1}{2} \cdot \frac{c}{\frac{\left(-b\right) - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{4}}
double f(double a, double b, double c) {
        double r29215 = b;
        double r29216 = -r29215;
        double r29217 = r29215 * r29215;
        double r29218 = 4.0;
        double r29219 = a;
        double r29220 = r29218 * r29219;
        double r29221 = c;
        double r29222 = r29220 * r29221;
        double r29223 = r29217 - r29222;
        double r29224 = sqrt(r29223);
        double r29225 = r29216 + r29224;
        double r29226 = 2.0;
        double r29227 = r29226 * r29219;
        double r29228 = r29225 / r29227;
        return r29228;
}

double f(double a, double b, double c) {
        double r29229 = 1.0;
        double r29230 = 2.0;
        double r29231 = r29229 / r29230;
        double r29232 = c;
        double r29233 = b;
        double r29234 = -r29233;
        double r29235 = r29233 * r29233;
        double r29236 = a;
        double r29237 = 4.0;
        double r29238 = r29232 * r29237;
        double r29239 = r29236 * r29238;
        double r29240 = r29235 - r29239;
        double r29241 = sqrt(r29240);
        double r29242 = r29234 - r29241;
        double r29243 = r29242 / r29237;
        double r29244 = r29232 / r29243;
        double r29245 = r29231 * r29244;
        return r29245;
}

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 + \left(4 \cdot a\right) \cdot c}}{\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 + \left(4 \cdot a\right) \cdot c}{\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 + \left(4 \cdot a\right) \cdot c\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 + \left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  9. Applied times-frac0.4

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019194 
(FPCore (a b c)
  :name "Quadratic roots, wide range"
  :pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))