Average Error: 43.7 → 12.1
Time: 12.5s
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}\]
\[-0.5 \cdot \frac{c}{b}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
-0.5 \cdot \frac{c}{b}
double f(double a, double b, double c) {
        double r77211 = b;
        double r77212 = -r77211;
        double r77213 = r77211 * r77211;
        double r77214 = 3.0;
        double r77215 = a;
        double r77216 = r77214 * r77215;
        double r77217 = c;
        double r77218 = r77216 * r77217;
        double r77219 = r77213 - r77218;
        double r77220 = sqrt(r77219);
        double r77221 = r77212 + r77220;
        double r77222 = r77221 / r77216;
        return r77222;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r77223 = -0.5;
        double r77224 = c;
        double r77225 = b;
        double r77226 = r77224 / r77225;
        double r77227 = r77223 * r77226;
        return r77227;
}

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

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Simplified43.7

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

    \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}}\]
  4. Final simplification12.1

    \[\leadsto -0.5 \cdot \frac{c}{b}\]

Reproduce

herbie shell --seed 2019325 
(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)))