Average Error: 28.2 → 0.5
Time: 8.2s
Precision: 64
\[1.05367121277235087 \cdot 10^{-8} \lt a \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt b \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt c \lt 94906265.6242515594\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{1 \cdot \frac{4 \cdot a}{\frac{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}{c}}}{2 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{1 \cdot \frac{4 \cdot a}{\frac{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}{c}}}{2 \cdot a}
double f(double a, double b, double c) {
        double r42032 = b;
        double r42033 = -r42032;
        double r42034 = r42032 * r42032;
        double r42035 = 4.0;
        double r42036 = a;
        double r42037 = r42035 * r42036;
        double r42038 = c;
        double r42039 = r42037 * r42038;
        double r42040 = r42034 - r42039;
        double r42041 = sqrt(r42040);
        double r42042 = r42033 + r42041;
        double r42043 = 2.0;
        double r42044 = r42043 * r42036;
        double r42045 = r42042 / r42044;
        return r42045;
}

double f(double a, double b, double c) {
        double r42046 = 1.0;
        double r42047 = 4.0;
        double r42048 = a;
        double r42049 = r42047 * r42048;
        double r42050 = b;
        double r42051 = -r42050;
        double r42052 = 6.0;
        double r42053 = pow(r42050, r42052);
        double r42054 = c;
        double r42055 = r42049 * r42054;
        double r42056 = 3.0;
        double r42057 = pow(r42055, r42056);
        double r42058 = r42053 - r42057;
        double r42059 = r42048 * r42054;
        double r42060 = fma(r42050, r42050, r42055);
        double r42061 = r42059 * r42060;
        double r42062 = 4.0;
        double r42063 = pow(r42050, r42062);
        double r42064 = fma(r42047, r42061, r42063);
        double r42065 = r42058 / r42064;
        double r42066 = sqrt(r42065);
        double r42067 = r42051 - r42066;
        double r42068 = r42067 / r42054;
        double r42069 = r42049 / r42068;
        double r42070 = r42046 * r42069;
        double r42071 = 2.0;
        double r42072 = r42071 * r42048;
        double r42073 = r42070 / r42072;
        return r42073;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.2

    \[\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.2

    \[\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 + 4 \cdot \left(a \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 flip3--0.5

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

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

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\color{blue}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}}}{2 \cdot a}\]
  9. Using strategy rm
  10. Applied *-un-lft-identity0.4

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}\right)}}}{2 \cdot a}\]
  11. Applied *-un-lft-identity0.4

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \left(0 + 4 \cdot \left(a \cdot c\right)\right)}}{1 \cdot \left(\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}\right)}}{2 \cdot a}\]
  12. Applied times-frac0.4

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}}}{2 \cdot a}\]
  13. Simplified0.4

    \[\leadsto \frac{\color{blue}{1} \cdot \frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}}{2 \cdot a}\]
  14. Simplified0.5

    \[\leadsto \frac{1 \cdot \color{blue}{\frac{4 \cdot a}{\frac{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}{c}}}}{2 \cdot a}\]
  15. Final simplification0.5

    \[\leadsto \frac{1 \cdot \frac{4 \cdot a}{\frac{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(4 \cdot a\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(4, \left(a \cdot c\right) \cdot \mathsf{fma}\left(b, b, \left(4 \cdot a\right) \cdot c\right), {b}^{4}\right)}}}{c}}}{2 \cdot a}\]

Reproduce

herbie shell --seed 2020033 +o rules:numerics
(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)))