Average Error: 44.1 → 43.0
Time: 24.6s
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{\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 \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)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -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{\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 \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)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, a \cdot c, b \cdot b\right)}}, -b\right)}{a \cdot 3}
double f(double a, double b, double c) {
        double r2540670 = b;
        double r2540671 = -r2540670;
        double r2540672 = r2540670 * r2540670;
        double r2540673 = 3.0;
        double r2540674 = a;
        double r2540675 = r2540673 * r2540674;
        double r2540676 = c;
        double r2540677 = r2540675 * r2540676;
        double r2540678 = r2540672 - r2540677;
        double r2540679 = sqrt(r2540678);
        double r2540680 = r2540671 + r2540679;
        double r2540681 = r2540680 / r2540675;
        return r2540681;
}

double f(double a, double b, double c) {
        double r2540682 = -3.0;
        double r2540683 = a;
        double r2540684 = c;
        double r2540685 = r2540683 * r2540684;
        double r2540686 = b;
        double r2540687 = r2540686 * r2540686;
        double r2540688 = fma(r2540682, r2540685, r2540687);
        double r2540689 = r2540688 * r2540688;
        double r2540690 = r2540689 * r2540688;
        double r2540691 = 0.3333333333333333;
        double r2540692 = pow(r2540690, r2540691);
        double r2540693 = cbrt(r2540692);
        double r2540694 = r2540693 * r2540693;
        double r2540695 = r2540693 * r2540694;
        double r2540696 = sqrt(r2540695);
        double r2540697 = sqrt(r2540696);
        double r2540698 = sqrt(r2540688);
        double r2540699 = sqrt(r2540698);
        double r2540700 = -r2540686;
        double r2540701 = fma(r2540697, r2540699, r2540700);
        double r2540702 = 3.0;
        double r2540703 = r2540683 * r2540702;
        double r2540704 = r2540701 / r2540703;
        return r2540704;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 44.1

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

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

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

    \[\leadsto \frac{\mathsf{fma}\left(\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)}}}}, \sqrt{\sqrt{\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{\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}}}}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}{3 \cdot a}\]
  11. Using strategy rm
  12. Applied add-cube-cbrt43.0

    \[\leadsto \frac{\mathsf{fma}\left(\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}}}}}}, \sqrt{\sqrt{\mathsf{fma}\left(-3, c \cdot a, b \cdot b\right)}}, -b\right)}{3 \cdot a}\]
  13. Final simplification43.0

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

Reproduce

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