Average Error: 28.6 → 0.5
Time: 7.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{\mathsf{fma}\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}, \left(-\sqrt{1}\right) + \sqrt{1}, \mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\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)}} \cdot \sqrt{1}\right)\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{\mathsf{fma}\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}, \left(-\sqrt{1}\right) + \sqrt{1}, \mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\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)}} \cdot \sqrt{1}\right)\right)}{c}}}{2 \cdot a}
double f(double a, double b, double c) {
        double r43906 = b;
        double r43907 = -r43906;
        double r43908 = r43906 * r43906;
        double r43909 = 4.0;
        double r43910 = a;
        double r43911 = r43909 * r43910;
        double r43912 = c;
        double r43913 = r43911 * r43912;
        double r43914 = r43908 - r43913;
        double r43915 = sqrt(r43914);
        double r43916 = r43907 + r43915;
        double r43917 = 2.0;
        double r43918 = r43917 * r43910;
        double r43919 = r43916 / r43918;
        return r43919;
}

double f(double a, double b, double c) {
        double r43920 = 1.0;
        double r43921 = 4.0;
        double r43922 = a;
        double r43923 = r43921 * r43922;
        double r43924 = b;
        double r43925 = r43924 * r43924;
        double r43926 = c;
        double r43927 = r43923 * r43926;
        double r43928 = r43925 - r43927;
        double r43929 = sqrt(r43928);
        double r43930 = sqrt(r43920);
        double r43931 = -r43930;
        double r43932 = r43931 + r43930;
        double r43933 = sqrt(r43924);
        double r43934 = -r43933;
        double r43935 = 6.0;
        double r43936 = pow(r43924, r43935);
        double r43937 = 3.0;
        double r43938 = pow(r43927, r43937);
        double r43939 = r43936 - r43938;
        double r43940 = r43922 * r43926;
        double r43941 = fma(r43924, r43924, r43927);
        double r43942 = r43940 * r43941;
        double r43943 = 4.0;
        double r43944 = pow(r43924, r43943);
        double r43945 = fma(r43921, r43942, r43944);
        double r43946 = r43939 / r43945;
        double r43947 = sqrt(r43946);
        double r43948 = r43947 * r43930;
        double r43949 = -r43948;
        double r43950 = fma(r43933, r43934, r43949);
        double r43951 = fma(r43929, r43932, r43950);
        double r43952 = r43951 / r43926;
        double r43953 = r43923 / r43952;
        double r43954 = r43920 * r43953;
        double r43955 = 2.0;
        double r43956 = r43955 * r43922;
        double r43957 = r43954 / r43956;
        return r43957;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.6

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

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

    \[\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 *-un-lft-identity0.5

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

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

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

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\color{blue}{\left(-\sqrt{b}\right) \cdot \sqrt{b}} - \sqrt{1} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
  10. Applied prod-diff0.5

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

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

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{1}\right) + \color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)}}}{2 \cdot a}\]
  13. Using strategy rm
  14. Applied flip3--0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\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)}}} \cdot \sqrt{1}\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)}}{2 \cdot a}\]
  15. Simplified0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\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)}} \cdot \sqrt{1}\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)}}{2 \cdot a}\]
  16. Simplified0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\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)}}} \cdot \sqrt{1}\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)}}{2 \cdot a}\]
  17. Using strategy rm
  18. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\color{blue}{1 \cdot \left(\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\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)}} \cdot \sqrt{1}\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)\right)}}}{2 \cdot a}\]
  19. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \left(0 + 4 \cdot \left(a \cdot c\right)\right)}}{1 \cdot \left(\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\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)}} \cdot \sqrt{1}\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)\right)}}{2 \cdot a}\]
  20. Applied times-frac0.5

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{0 + 4 \cdot \left(a \cdot c\right)}{\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\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)}} \cdot \sqrt{1}\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)}}}{2 \cdot a}\]
  21. Simplified0.5

    \[\leadsto \frac{\color{blue}{1} \cdot \frac{0 + 4 \cdot \left(a \cdot c\right)}{\mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\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)}} \cdot \sqrt{1}\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \left(\left(-\sqrt{1}\right) + \sqrt{1}\right)}}{2 \cdot a}\]
  22. Simplified0.5

    \[\leadsto \frac{1 \cdot \color{blue}{\frac{4 \cdot a}{\frac{\mathsf{fma}\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}, \left(-\sqrt{1}\right) + \sqrt{1}, \mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\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)}} \cdot \sqrt{1}\right)\right)}{c}}}}{2 \cdot a}\]
  23. Final simplification0.5

    \[\leadsto \frac{1 \cdot \frac{4 \cdot a}{\frac{\mathsf{fma}\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}, \left(-\sqrt{1}\right) + \sqrt{1}, \mathsf{fma}\left(\sqrt{b}, -\sqrt{b}, -\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)}} \cdot \sqrt{1}\right)\right)}{c}}}{2 \cdot a}\]

Reproduce

herbie shell --seed 2020065 +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)))