Average Error: 52.6 → 0.4
Time: 6.8s
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(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{1 \cdot \frac{\left(3 \cdot a\right) \cdot c + 0}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{1 \cdot \frac{\left(3 \cdot a\right) \cdot c + 0}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}
double f(double a, double b, double c) {
        double r93273 = b;
        double r93274 = -r93273;
        double r93275 = r93273 * r93273;
        double r93276 = 3.0;
        double r93277 = a;
        double r93278 = r93276 * r93277;
        double r93279 = c;
        double r93280 = r93278 * r93279;
        double r93281 = r93275 - r93280;
        double r93282 = sqrt(r93281);
        double r93283 = r93274 + r93282;
        double r93284 = r93283 / r93278;
        return r93284;
}

double f(double a, double b, double c) {
        double r93285 = 1.0;
        double r93286 = 3.0;
        double r93287 = a;
        double r93288 = r93286 * r93287;
        double r93289 = c;
        double r93290 = r93288 * r93289;
        double r93291 = 0.0;
        double r93292 = r93290 + r93291;
        double r93293 = b;
        double r93294 = -r93293;
        double r93295 = r93293 * r93293;
        double r93296 = r93295 - r93290;
        double r93297 = sqrt(r93296);
        double r93298 = r93294 - r93297;
        double r93299 = r93292 / r93298;
        double r93300 = r93285 * r93299;
        double r93301 = r93300 / r93288;
        return r93301;
}

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

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Using strategy rm
  3. Applied flip-+52.6

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

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

    \[\leadsto \frac{\frac{\left({b}^{2} - {b}^{2}\right) + 3 \cdot \left(a \cdot c\right)}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}}{3 \cdot a}\]
  7. Applied add-sqr-sqrt0.7

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

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

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

    \[\leadsto \frac{\color{blue}{\left(1 \cdot \sqrt{\left(3 \cdot a\right) \cdot c}\right)} \cdot \frac{\sqrt{\left({b}^{2} - {b}^{2}\right) + 3 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  12. Applied associate-*l*0.6

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

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

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

Reproduce

herbie shell --seed 2020025 
(FPCore (a b c)
  :name "Cubic critical, 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) (* (* 3 a) c)))) (* 3 a)))