Average Error: 43.4 → 0.2
Time: 16.3s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}
double f(double a, double b, double c) {
        double r70291 = b;
        double r70292 = -r70291;
        double r70293 = r70291 * r70291;
        double r70294 = 3.0;
        double r70295 = a;
        double r70296 = r70294 * r70295;
        double r70297 = c;
        double r70298 = r70296 * r70297;
        double r70299 = r70293 - r70298;
        double r70300 = sqrt(r70299);
        double r70301 = r70292 + r70300;
        double r70302 = r70301 / r70296;
        return r70302;
}

double f(double a, double b, double c) {
        double r70303 = c;
        double r70304 = b;
        double r70305 = -r70304;
        double r70306 = r70304 * r70304;
        double r70307 = 3.0;
        double r70308 = a;
        double r70309 = r70307 * r70308;
        double r70310 = r70309 * r70303;
        double r70311 = r70306 - r70310;
        double r70312 = sqrt(r70311);
        double r70313 = r70305 - r70312;
        double r70314 = r70303 / r70313;
        return r70314;
}

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 43.4

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

    \[\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}{0 + 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 clear-num0.6

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

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

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

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

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

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

    \[\leadsto \frac{\frac{1}{1}}{\color{blue}{1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{c}}}\]
  14. Using strategy rm
  15. Applied add-cube-cbrt0.3

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

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

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

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

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

Reproduce

herbie shell --seed 2019347 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e+15) (< 1.11022e-16 b 9.0072e+15) (< 1.11022e-16 c 9.0072e+15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))