Average Error: 43.9 → 43.3
Time: 29.8s
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}\]
\[\left(\sqrt[3]{\sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}{3 \cdot a}}} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}{3 \cdot a}}} \cdot \sqrt[3]{\sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}{3 \cdot a}}}\right)\right) \cdot \left(\sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}{3 \cdot a}} \cdot \sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}{3 \cdot a}}\right)\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\left(\sqrt[3]{\sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}{3 \cdot a}}} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}{3 \cdot a}}} \cdot \sqrt[3]{\sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}{3 \cdot a}}}\right)\right) \cdot \left(\sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}{3 \cdot a}} \cdot \sqrt[3]{\frac{\mathsf{fma}\left(\sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, \sqrt{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)}}, -b\right)}{3 \cdot a}}\right)
double f(double a, double b, double c) {
        double r4139644 = b;
        double r4139645 = -r4139644;
        double r4139646 = r4139644 * r4139644;
        double r4139647 = 3.0;
        double r4139648 = a;
        double r4139649 = r4139647 * r4139648;
        double r4139650 = c;
        double r4139651 = r4139649 * r4139650;
        double r4139652 = r4139646 - r4139651;
        double r4139653 = sqrt(r4139652);
        double r4139654 = r4139645 + r4139653;
        double r4139655 = r4139654 / r4139649;
        return r4139655;
}

double f(double a, double b, double c) {
        double r4139656 = -3.0;
        double r4139657 = a;
        double r4139658 = r4139656 * r4139657;
        double r4139659 = c;
        double r4139660 = b;
        double r4139661 = r4139660 * r4139660;
        double r4139662 = fma(r4139658, r4139659, r4139661);
        double r4139663 = sqrt(r4139662);
        double r4139664 = sqrt(r4139663);
        double r4139665 = -r4139660;
        double r4139666 = fma(r4139664, r4139664, r4139665);
        double r4139667 = 3.0;
        double r4139668 = r4139667 * r4139657;
        double r4139669 = r4139666 / r4139668;
        double r4139670 = cbrt(r4139669);
        double r4139671 = cbrt(r4139670);
        double r4139672 = r4139671 * r4139671;
        double r4139673 = r4139671 * r4139672;
        double r4139674 = r4139670 * r4139670;
        double r4139675 = r4139673 * r4139674;
        return r4139675;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 43.9

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

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

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

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

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

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

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

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

Reproduce

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