Average Error: 0.2 → 0.5
Time: 21.1s
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(3 + a\right)\right)\right) - 1\]
\[\left(\sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\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, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\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, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\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(3 + a\right)\right)\right) - 1
\left(\sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\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, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\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, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\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 r8300458 = a;
        double r8300459 = r8300458 * r8300458;
        double r8300460 = b;
        double r8300461 = r8300460 * r8300460;
        double r8300462 = r8300459 + r8300461;
        double r8300463 = 2.0;
        double r8300464 = pow(r8300462, r8300463);
        double r8300465 = 4.0;
        double r8300466 = 1.0;
        double r8300467 = r8300466 - r8300458;
        double r8300468 = r8300459 * r8300467;
        double r8300469 = 3.0;
        double r8300470 = r8300469 + r8300458;
        double r8300471 = r8300461 * r8300470;
        double r8300472 = r8300468 + r8300471;
        double r8300473 = r8300465 * r8300472;
        double r8300474 = r8300464 + r8300473;
        double r8300475 = r8300474 - r8300466;
        return r8300475;
}

double f(double a, double b) {
        double r8300476 = 4.0;
        double r8300477 = a;
        double r8300478 = r8300477 * r8300477;
        double r8300479 = r8300477 - r8300478;
        double r8300480 = b;
        double r8300481 = r8300480 * r8300480;
        double r8300482 = 3.0;
        double r8300483 = r8300477 + r8300482;
        double r8300484 = r8300481 * r8300483;
        double r8300485 = fma(r8300477, r8300479, r8300484);
        double r8300486 = fma(r8300477, r8300477, r8300481);
        double r8300487 = -1.0;
        double r8300488 = fma(r8300486, r8300486, r8300487);
        double r8300489 = fma(r8300476, r8300485, r8300488);
        double r8300490 = cbrt(r8300489);
        double r8300491 = r8300490 * r8300490;
        double r8300492 = r8300491 * r8300490;
        return r8300492;
}

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(3 + a\right)\right)\right) - 1\]
  2. Simplified0.2

    \[\leadsto \color{blue}{\mathsf{fma}\left(4, \mathsf{fma}\left(a, a - a \cdot a, \left(a + 3\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, a - a \cdot a, \left(a + 3\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, a - a \cdot a, \left(a + 3\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, a - a \cdot a, \left(a + 3\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, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\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, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\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, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\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 2019151 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (24)"
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a))))) 1))