Average Error: 28.3 → 0.3
Time: 3.1m
Precision: 64
\[1.0536712127723509 \cdot 10^{-08} \lt a \lt 94906265.62425156 \land 1.0536712127723509 \cdot 10^{-08} \lt b \lt 94906265.62425156 \land 1.0536712127723509 \cdot 10^{-08} \lt c \lt 94906265.62425156\]
\[\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 - c \cdot \left(3 \cdot a\right)}}\]
\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 - c \cdot \left(3 \cdot a\right)}}
double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r17035910 = b;
        double r17035911 = -r17035910;
        double r17035912 = r17035910 * r17035910;
        double r17035913 = 3.0;
        double r17035914 = a;
        double r17035915 = r17035913 * r17035914;
        double r17035916 = c;
        double r17035917 = r17035915 * r17035916;
        double r17035918 = r17035912 - r17035917;
        double r17035919 = sqrt(r17035918);
        double r17035920 = r17035911 + r17035919;
        double r17035921 = r17035920 / r17035915;
        return r17035921;
}

double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r17035922 = c;
        double r17035923 = b;
        double r17035924 = -r17035923;
        double r17035925 = r17035923 * r17035923;
        double r17035926 = 3.0;
        double r17035927 = a;
        double r17035928 = r17035926 * r17035927;
        double r17035929 = r17035922 * r17035928;
        double r17035930 = r17035925 - r17035929;
        double r17035931 = sqrt(r17035930);
        double r17035932 = r17035924 - r17035931;
        double r17035933 = r17035922 / r17035932;
        return r17035933;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 28.3

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

    \[\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. Applied associate-/l/28.3

    \[\leadsto \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(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
  5. Simplified0.6

    \[\leadsto \frac{\color{blue}{3 \cdot \left(c \cdot a\right)}}{\left(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}\]
  6. Using strategy rm
  7. Applied associate-/l*0.6

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

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

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

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

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

    \[\leadsto 1 \cdot \color{blue}{\frac{\frac{c \cdot \left(3 \cdot a\right)}{3 \cdot a}}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}}\]
  14. Taylor expanded around inf 0.3

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

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

Reproduce

herbie shell --seed 2019121 +o rules:numerics
(FPCore (a b c d)
  :name "Cubic critical, narrow range"
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))