Average Error: 28.4 → 0.4
Time: 9.4s
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{\left(4 \cdot a\right) \cdot c}{-\left(b \cdot \left(2 \cdot a\right) + \left(2 \cdot a\right) \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\left(4 \cdot a\right) \cdot c}{-\left(b \cdot \left(2 \cdot a\right) + \left(2 \cdot a\right) \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}
double f(double a, double b, double c) {
        double r36098 = b;
        double r36099 = -r36098;
        double r36100 = r36098 * r36098;
        double r36101 = 4.0;
        double r36102 = a;
        double r36103 = r36101 * r36102;
        double r36104 = c;
        double r36105 = r36103 * r36104;
        double r36106 = r36100 - r36105;
        double r36107 = sqrt(r36106);
        double r36108 = r36099 + r36107;
        double r36109 = 2.0;
        double r36110 = r36109 * r36102;
        double r36111 = r36108 / r36110;
        return r36111;
}

double f(double a, double b, double c) {
        double r36112 = 4.0;
        double r36113 = a;
        double r36114 = r36112 * r36113;
        double r36115 = c;
        double r36116 = r36114 * r36115;
        double r36117 = b;
        double r36118 = 2.0;
        double r36119 = r36118 * r36113;
        double r36120 = r36117 * r36119;
        double r36121 = r36117 * r36117;
        double r36122 = r36121 - r36116;
        double r36123 = sqrt(r36122);
        double r36124 = r36119 * r36123;
        double r36125 = r36120 + r36124;
        double r36126 = -r36125;
        double r36127 = r36116 / r36126;
        return r36127;
}

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

    \[\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 + \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
  5. Using strategy rm
  6. Applied div-inv0.5

    \[\leadsto \frac{\color{blue}{\left(0 + \left(4 \cdot a\right) \cdot c\right) \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  7. Applied associate-/l*0.5

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

    \[\leadsto \frac{0 + \left(4 \cdot a\right) \cdot c}{\color{blue}{\left(2 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}\]
  9. Using strategy rm
  10. Applied sub-neg0.4

    \[\leadsto \frac{0 + \left(4 \cdot a\right) \cdot c}{\left(2 \cdot a\right) \cdot \color{blue}{\left(\left(-b\right) + \left(-\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right)}}\]
  11. Applied distribute-lft-in0.4

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

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

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

Reproduce

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