Average Error: 43.8 → 12.0
Time: 15.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}\]
\[\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 r2407930 = b;
        double r2407931 = -r2407930;
        double r2407932 = r2407930 * r2407930;
        double r2407933 = 3.0;
        double r2407934 = a;
        double r2407935 = r2407933 * r2407934;
        double r2407936 = c;
        double r2407937 = r2407935 * r2407936;
        double r2407938 = r2407932 - r2407937;
        double r2407939 = sqrt(r2407938);
        double r2407940 = r2407931 + r2407939;
        double r2407941 = r2407940 / r2407935;
        return r2407941;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r2407942 = c;
        double r2407943 = b;
        double r2407944 = r2407942 / r2407943;
        double r2407945 = -0.5;
        double r2407946 = r2407944 * r2407945;
        return r2407946;
}

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

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

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

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

Reproduce

herbie shell --seed 2019192 +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)))