Average Error: 29.0 → 0.3
Time: 17.7s
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{4 \cdot c}{\left(-\left(b + \sqrt{\frac{{b}^{4} - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}\right)\right) \cdot 2}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{4 \cdot c}{\left(-\left(b + \sqrt{\frac{{b}^{4} - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}\right)\right) \cdot 2}
double f(double a, double b, double c) {
        double r42171 = b;
        double r42172 = -r42171;
        double r42173 = r42171 * r42171;
        double r42174 = 4.0;
        double r42175 = a;
        double r42176 = r42174 * r42175;
        double r42177 = c;
        double r42178 = r42176 * r42177;
        double r42179 = r42173 - r42178;
        double r42180 = sqrt(r42179);
        double r42181 = r42172 + r42180;
        double r42182 = 2.0;
        double r42183 = r42182 * r42175;
        double r42184 = r42181 / r42183;
        return r42184;
}

double f(double a, double b, double c) {
        double r42185 = 4.0;
        double r42186 = c;
        double r42187 = r42185 * r42186;
        double r42188 = b;
        double r42189 = 4.0;
        double r42190 = pow(r42188, r42189);
        double r42191 = a;
        double r42192 = r42191 * r42186;
        double r42193 = r42185 * r42192;
        double r42194 = r42193 * r42193;
        double r42195 = r42190 - r42194;
        double r42196 = r42188 * r42188;
        double r42197 = r42185 * r42191;
        double r42198 = r42197 * r42186;
        double r42199 = r42196 + r42198;
        double r42200 = r42195 / r42199;
        double r42201 = sqrt(r42200);
        double r42202 = r42188 + r42201;
        double r42203 = -r42202;
        double r42204 = 2.0;
        double r42205 = r42203 * r42204;
        double r42206 = r42187 / r42205;
        return r42206;
}

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 29.0

    \[\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-+29.0

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

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

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\sqrt[3]{\color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{3}}}}}}{2 \cdot a}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{\sqrt[3]{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{3}}}\right)}}}{2 \cdot a}\]
  10. 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(\left(-b\right) - \sqrt{\sqrt[3]{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{3}}}\right)}}{2 \cdot a}\]
  11. Applied times-frac0.5

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

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

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

    \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{\frac{4 \cdot \left(a \cdot c\right)}{a}}{-\left(b + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}\]
  15. Using strategy rm
  16. Applied flip--0.4

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

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

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

Reproduce

herbie shell --seed 2019298 
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (< 1.05367121277235087e-8 a 94906265.6242515594) (< 1.05367121277235087e-8 b 94906265.6242515594) (< 1.05367121277235087e-8 c 94906265.6242515594))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))