Average Error: 0.2 → 0.5
Time: 29.5s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1\]
\[\left(\sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a, \mathsf{fma}\left(a, a, a\right), \left(b \cdot b\right) \cdot \mathsf{fma}\left(a, -3, 1\right)\right), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a, \mathsf{fma}\left(a, a, a\right), \left(b \cdot b\right) \cdot \mathsf{fma}\left(a, -3, 1\right)\right), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a, \mathsf{fma}\left(a, a, a\right), \left(b \cdot b\right) \cdot \mathsf{fma}\left(a, -3, 1\right)\right), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)\right)}\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1
\left(\sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a, \mathsf{fma}\left(a, a, a\right), \left(b \cdot b\right) \cdot \mathsf{fma}\left(a, -3, 1\right)\right), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a, \mathsf{fma}\left(a, a, a\right), \left(b \cdot b\right) \cdot \mathsf{fma}\left(a, -3, 1\right)\right), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a, \mathsf{fma}\left(a, a, a\right), \left(b \cdot b\right) \cdot \mathsf{fma}\left(a, -3, 1\right)\right), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)\right)}
double f(double a, double b) {
        double r4228790 = a;
        double r4228791 = r4228790 * r4228790;
        double r4228792 = b;
        double r4228793 = r4228792 * r4228792;
        double r4228794 = r4228791 + r4228793;
        double r4228795 = 2.0;
        double r4228796 = pow(r4228794, r4228795);
        double r4228797 = 4.0;
        double r4228798 = 1.0;
        double r4228799 = r4228798 + r4228790;
        double r4228800 = r4228791 * r4228799;
        double r4228801 = 3.0;
        double r4228802 = r4228801 * r4228790;
        double r4228803 = r4228798 - r4228802;
        double r4228804 = r4228793 * r4228803;
        double r4228805 = r4228800 + r4228804;
        double r4228806 = r4228797 * r4228805;
        double r4228807 = r4228796 + r4228806;
        double r4228808 = r4228807 - r4228798;
        return r4228808;
}

double f(double a, double b) {
        double r4228809 = 4.0;
        double r4228810 = a;
        double r4228811 = fma(r4228810, r4228810, r4228810);
        double r4228812 = b;
        double r4228813 = r4228812 * r4228812;
        double r4228814 = -3.0;
        double r4228815 = 1.0;
        double r4228816 = fma(r4228810, r4228814, r4228815);
        double r4228817 = r4228813 * r4228816;
        double r4228818 = fma(r4228810, r4228811, r4228817);
        double r4228819 = fma(r4228810, r4228810, r4228813);
        double r4228820 = -1.0;
        double r4228821 = fma(r4228819, r4228819, r4228820);
        double r4228822 = fma(r4228809, r4228818, r4228821);
        double r4228823 = cbrt(r4228822);
        double r4228824 = r4228823 * r4228823;
        double r4228825 = r4228824 * r4228823;
        return r4228825;
}

Error

Bits error versus a

Bits error versus b

Derivation

  1. Initial program 0.2

    \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1\]
  2. Simplified0.2

    \[\leadsto \color{blue}{\mathsf{fma}\left(4, \mathsf{fma}\left(a, \mathsf{fma}\left(a, a, a\right), \mathsf{fma}\left(a, -3, 1\right) \cdot \left(b \cdot b\right)\right), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)\right)}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.5

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

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

Reproduce

herbie shell --seed 2019146 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (25)"
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (+ 1 a)) (* (* b b) (- 1 (* 3 a)))))) 1))