Average Error: 52.7 → 6.1
Time: 36.2s
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.0 \cdot a\right) \cdot c}}{3.0 \cdot a}\]
\[\frac{c}{b} \cdot -0.5\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3.0 \cdot a\right) \cdot c}}{3.0 \cdot a}
\frac{c}{b} \cdot -0.5
double f(double a, double b, double c) {
        double r3688303 = b;
        double r3688304 = -r3688303;
        double r3688305 = r3688303 * r3688303;
        double r3688306 = 3.0;
        double r3688307 = a;
        double r3688308 = r3688306 * r3688307;
        double r3688309 = c;
        double r3688310 = r3688308 * r3688309;
        double r3688311 = r3688305 - r3688310;
        double r3688312 = sqrt(r3688311);
        double r3688313 = r3688304 + r3688312;
        double r3688314 = r3688313 / r3688308;
        return r3688314;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r3688315 = c;
        double r3688316 = b;
        double r3688317 = r3688315 / r3688316;
        double r3688318 = -0.5;
        double r3688319 = r3688317 * r3688318;
        return r3688319;
}

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

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

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

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

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

Reproduce

herbie shell --seed 2019165 
(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.0 a) c)))) (* 3.0 a)))