Average Error: 44.0 → 11.9
Time: 16.9s
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 r5062674 = b;
        double r5062675 = -r5062674;
        double r5062676 = r5062674 * r5062674;
        double r5062677 = 3.0;
        double r5062678 = a;
        double r5062679 = r5062677 * r5062678;
        double r5062680 = c;
        double r5062681 = r5062679 * r5062680;
        double r5062682 = r5062676 - r5062681;
        double r5062683 = sqrt(r5062682);
        double r5062684 = r5062675 + r5062683;
        double r5062685 = r5062684 / r5062679;
        return r5062685;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r5062686 = c;
        double r5062687 = b;
        double r5062688 = r5062686 / r5062687;
        double r5062689 = -0.5;
        double r5062690 = r5062688 * r5062689;
        return r5062690;
}

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

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

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

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

Reproduce

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