Average Error: 44.0 → 43.0
Time: 27.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(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\left(\sqrt[3]{{\left(\left(\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)}^{\frac{1}{3}}} \cdot \sqrt[3]{{\left(\left(\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)}^{\frac{1}{3}}}\right) \cdot \sqrt[3]{{\left(\left(\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)}^{\frac{1}{3}}}}}, -b\right)}{a \cdot 3}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, \sqrt{\sqrt{\left(\sqrt[3]{{\left(\left(\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)}^{\frac{1}{3}}} \cdot \sqrt[3]{{\left(\left(\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)}^{\frac{1}{3}}}\right) \cdot \sqrt[3]{{\left(\left(\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)\right)}^{\frac{1}{3}}}}}, -b\right)}{a \cdot 3}
double f(double a, double b, double c) {
        double r2010897 = b;
        double r2010898 = -r2010897;
        double r2010899 = r2010897 * r2010897;
        double r2010900 = 3.0;
        double r2010901 = a;
        double r2010902 = r2010900 * r2010901;
        double r2010903 = c;
        double r2010904 = r2010902 * r2010903;
        double r2010905 = r2010899 - r2010904;
        double r2010906 = sqrt(r2010905);
        double r2010907 = r2010898 + r2010906;
        double r2010908 = r2010907 / r2010902;
        return r2010908;
}

double f(double a, double b, double c) {
        double r2010909 = -3.0;
        double r2010910 = a;
        double r2010911 = c;
        double r2010912 = r2010910 * r2010911;
        double r2010913 = b;
        double r2010914 = r2010913 * r2010913;
        double r2010915 = fma(r2010909, r2010912, r2010914);
        double r2010916 = sqrt(r2010915);
        double r2010917 = sqrt(r2010916);
        double r2010918 = r2010915 * r2010915;
        double r2010919 = r2010918 * r2010915;
        double r2010920 = 0.3333333333333333;
        double r2010921 = pow(r2010919, r2010920);
        double r2010922 = cbrt(r2010921);
        double r2010923 = r2010922 * r2010922;
        double r2010924 = r2010923 * r2010922;
        double r2010925 = sqrt(r2010924);
        double r2010926 = sqrt(r2010925);
        double r2010927 = -r2010913;
        double r2010928 = fma(r2010917, r2010926, r2010927);
        double r2010929 = 3.0;
        double r2010930 = r2010910 * r2010929;
        double r2010931 = r2010928 / r2010930;
        return r2010931;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 44.0

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Simplified44.0

    \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)} - b}{3 \cdot a}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt44.0

    \[\leadsto \frac{\sqrt{\color{blue}{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}} - b}{3 \cdot a}\]
  5. Applied sqrt-prod44.0

    \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}} - b}{3 \cdot a}\]
  6. Applied fma-neg43.4

    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}}{3 \cdot a}\]
  7. Using strategy rm
  8. Applied add-cbrt-cube43.4

    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, \sqrt{\sqrt{\color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right) \cdot \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}}}, -b\right)}{3 \cdot a}\]
  9. Using strategy rm
  10. Applied pow1/343.1

    \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, \sqrt{\sqrt{\color{blue}{{\left(\left(\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right) \cdot \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right) \cdot \mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)\right)}^{\frac{1}{3}}}}}, -b\right)}{3 \cdot a}\]
  11. Using strategy rm
  12. Applied add-cube-cbrt43.0

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

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

Reproduce

herbie shell --seed 2019155 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, 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) (* (* 3 a) c)))) (* 3 a)))