Average Error: 0.2 → 0.5
Time: 30.6s
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 r4148506 = a;
        double r4148507 = r4148506 * r4148506;
        double r4148508 = b;
        double r4148509 = r4148508 * r4148508;
        double r4148510 = r4148507 + r4148509;
        double r4148511 = 2.0;
        double r4148512 = pow(r4148510, r4148511);
        double r4148513 = 4.0;
        double r4148514 = 1.0;
        double r4148515 = r4148514 + r4148506;
        double r4148516 = r4148507 * r4148515;
        double r4148517 = 3.0;
        double r4148518 = r4148517 * r4148506;
        double r4148519 = r4148514 - r4148518;
        double r4148520 = r4148509 * r4148519;
        double r4148521 = r4148516 + r4148520;
        double r4148522 = r4148513 * r4148521;
        double r4148523 = r4148512 + r4148522;
        double r4148524 = r4148523 - r4148514;
        return r4148524;
}

double f(double a, double b) {
        double r4148525 = 4.0;
        double r4148526 = a;
        double r4148527 = fma(r4148526, r4148526, r4148526);
        double r4148528 = b;
        double r4148529 = r4148528 * r4148528;
        double r4148530 = -3.0;
        double r4148531 = 1.0;
        double r4148532 = fma(r4148526, r4148530, r4148531);
        double r4148533 = r4148529 * r4148532;
        double r4148534 = fma(r4148526, r4148527, r4148533);
        double r4148535 = fma(r4148526, r4148526, r4148529);
        double r4148536 = -1.0;
        double r4148537 = fma(r4148535, r4148535, r4148536);
        double r4148538 = fma(r4148525, r4148534, r4148537);
        double r4148539 = cbrt(r4148538);
        double r4148540 = r4148539 * r4148539;
        double r4148541 = r4148540 * r4148539;
        return r4148541;
}

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))