Average Error: 28.9 → 0.5
Time: 17.2s
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(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\frac{\frac{3 \cdot c}{\frac{3}{a}}}{a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot c\right) \cdot a}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{\frac{3 \cdot c}{\frac{3}{a}}}{a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot c\right) \cdot a}}
double f(double a, double b, double c) {
        double r70727 = b;
        double r70728 = -r70727;
        double r70729 = r70727 * r70727;
        double r70730 = 3.0;
        double r70731 = a;
        double r70732 = r70730 * r70731;
        double r70733 = c;
        double r70734 = r70732 * r70733;
        double r70735 = r70729 - r70734;
        double r70736 = sqrt(r70735);
        double r70737 = r70728 + r70736;
        double r70738 = r70737 / r70732;
        return r70738;
}

double f(double a, double b, double c) {
        double r70739 = 3.0;
        double r70740 = c;
        double r70741 = r70739 * r70740;
        double r70742 = a;
        double r70743 = r70739 / r70742;
        double r70744 = r70741 / r70743;
        double r70745 = r70744 / r70742;
        double r70746 = b;
        double r70747 = -r70746;
        double r70748 = r70746 * r70746;
        double r70749 = r70741 * r70742;
        double r70750 = r70748 - r70749;
        double r70751 = sqrt(r70750);
        double r70752 = r70747 - r70751;
        double r70753 = r70745 / r70752;
        return r70753;
}

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 28.9

    \[\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.9

    \[\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.4

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

    \[\leadsto \frac{\frac{\left(b \cdot b - b \cdot b\right) + c \cdot \left(a \cdot 3\right)}{\color{blue}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}}}{3 \cdot a}\]
  6. Using strategy rm
  7. Applied div-inv0.5

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019196 
(FPCore (a b c)
  :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.0 a) c)))) (* 3.0 a)))