Average Error: 43.8 → 12.0
Time: 19.4s
Precision: 64
\[1.1102230246251565 \cdot 10^{-16} \lt a \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt b \lt 9007199254740992.0 \land 1.1102230246251565 \cdot 10^{-16} \lt c \lt 9007199254740992.0\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{-c}{b}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{-c}{b}
double f(double a, double b, double c) {
        double r1959150 = b;
        double r1959151 = -r1959150;
        double r1959152 = r1959150 * r1959150;
        double r1959153 = 4.0;
        double r1959154 = a;
        double r1959155 = r1959153 * r1959154;
        double r1959156 = c;
        double r1959157 = r1959155 * r1959156;
        double r1959158 = r1959152 - r1959157;
        double r1959159 = sqrt(r1959158);
        double r1959160 = r1959151 + r1959159;
        double r1959161 = 2.0;
        double r1959162 = r1959161 * r1959154;
        double r1959163 = r1959160 / r1959162;
        return r1959163;
}

double f(double __attribute__((unused)) a, double b, double c) {
        double r1959164 = c;
        double r1959165 = -r1959164;
        double r1959166 = b;
        double r1959167 = r1959165 / r1959166;
        return r1959167;
}

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(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
  2. Simplified43.8

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

    \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}}\]
  4. Simplified12.0

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

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

Reproduce

herbie shell --seed 2019163 
(FPCore (a b c)
  :name "Quadratic roots, 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) (* (* 4 a) c)))) (* 2 a)))