Average Error: 44.0 → 11.9
Time: 15.7s
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}{b} \cdot -0.5\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{c}{b} \cdot -0.5
double f(double a, double b, double c) {
        double r3112247 = b;
        double r3112248 = -r3112247;
        double r3112249 = r3112247 * r3112247;
        double r3112250 = 3.0;
        double r3112251 = a;
        double r3112252 = r3112250 * r3112251;
        double r3112253 = c;
        double r3112254 = r3112252 * r3112253;
        double r3112255 = r3112249 - r3112254;
        double r3112256 = sqrt(r3112255);
        double r3112257 = r3112248 + r3112256;
        double r3112258 = r3112257 / r3112252;
        return r3112258;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r3112259 = c;
        double r3112260 = b;
        double r3112261 = r3112259 / r3112260;
        double r3112262 = -0.5;
        double r3112263 = r3112261 * r3112262;
        return r3112263;
}

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 44.0

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Taylor expanded around inf 11.9

    \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}}\]
  3. Final simplification11.9

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))