Average Error: 52.3 → 6.4
Time: 41.5s
Precision: 64
\[4.930380657631324 \cdot 10^{-32} \lt a \lt 2.028240960365167 \cdot 10^{+31} \land 4.930380657631324 \cdot 10^{-32} \lt b \lt 2.028240960365167 \cdot 10^{+31} \land 4.930380657631324 \cdot 10^{-32} \lt c \lt 2.028240960365167 \cdot 10^{+31}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{c}{b} \cdot \frac{-1}{2}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{c}{b} \cdot \frac{-1}{2}
double f(double a, double b, double c) {
        double r4072907 = b;
        double r4072908 = -r4072907;
        double r4072909 = r4072907 * r4072907;
        double r4072910 = 3.0;
        double r4072911 = a;
        double r4072912 = r4072910 * r4072911;
        double r4072913 = c;
        double r4072914 = r4072912 * r4072913;
        double r4072915 = r4072909 - r4072914;
        double r4072916 = sqrt(r4072915);
        double r4072917 = r4072908 + r4072916;
        double r4072918 = r4072917 / r4072912;
        return r4072918;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r4072919 = c;
        double r4072920 = b;
        double r4072921 = r4072919 / r4072920;
        double r4072922 = -0.5;
        double r4072923 = r4072921 * r4072922;
        return r4072923;
}

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 52.3

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

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

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

    \[\leadsto \frac{c}{b} \cdot \frac{-1}{2}\]

Reproduce

herbie shell --seed 2019142 
(FPCore (a b c)
  :name "Cubic critical, wide range"
  :pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))