Average Error: 28.5 → 0.5
Time: 18.8s
Precision: 64
\[1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt a \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt b \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt c \lt 94906265.62425155937671661376953125\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{\left(4 \cdot c\right) \cdot a}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(c \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot \left(4 \cdot a\right)\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{\left(4 \cdot c\right) \cdot a}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(c \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot \left(4 \cdot a\right)\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}
double f(double a, double b, double c) {
        double r43109 = b;
        double r43110 = -r43109;
        double r43111 = r43109 * r43109;
        double r43112 = 4.0;
        double r43113 = a;
        double r43114 = r43112 * r43113;
        double r43115 = c;
        double r43116 = r43114 * r43115;
        double r43117 = r43111 - r43116;
        double r43118 = sqrt(r43117);
        double r43119 = r43110 + r43118;
        double r43120 = 2.0;
        double r43121 = r43120 * r43113;
        double r43122 = r43119 / r43121;
        return r43122;
}

double f(double a, double b, double c) {
        double r43123 = 4.0;
        double r43124 = c;
        double r43125 = r43123 * r43124;
        double r43126 = a;
        double r43127 = r43125 * r43126;
        double r43128 = b;
        double r43129 = -r43128;
        double r43130 = 4.0;
        double r43131 = pow(r43128, r43130);
        double r43132 = r43124 * r43124;
        double r43133 = r43123 * r43126;
        double r43134 = r43133 * r43133;
        double r43135 = r43132 * r43134;
        double r43136 = r43131 - r43135;
        double r43137 = r43128 * r43128;
        double r43138 = r43133 * r43124;
        double r43139 = r43137 + r43138;
        double r43140 = r43136 / r43139;
        double r43141 = sqrt(r43140);
        double r43142 = r43129 - r43141;
        double r43143 = r43127 / r43142;
        double r43144 = 2.0;
        double r43145 = r43144 * r43126;
        double r43146 = r43143 / r43145;
        return r43146;
}

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 28.5

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
  2. Using strategy rm
  3. Applied flip-+28.5

    \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  4. Simplified0.4

    \[\leadsto \frac{\frac{\color{blue}{0 + a \cdot \left(4 \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
  5. Using strategy rm
  6. Applied flip--0.5

    \[\leadsto \frac{\frac{0 + a \cdot \left(4 \cdot c\right)}{\left(-b\right) - \sqrt{\color{blue}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(\left(4 \cdot a\right) \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot c\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}}{2 \cdot a}\]
  7. Simplified0.5

    \[\leadsto \frac{\frac{0 + a \cdot \left(4 \cdot c\right)}{\left(-b\right) - \sqrt{\frac{\color{blue}{{b}^{4} - \left(c \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot \left(4 \cdot a\right)\right)}}{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  8. Final simplification0.5

    \[\leadsto \frac{\frac{\left(4 \cdot c\right) \cdot a}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(c \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot \left(4 \cdot a\right)\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]

Reproduce

herbie shell --seed 2019325 
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))