Average Error: 0.2 → 0.6
Time: 24.7s
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\]
\[\mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\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 \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\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)\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
\mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\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 \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\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)\right)
double f(double a, double b) {
        double r4493433 = a;
        double r4493434 = r4493433 * r4493433;
        double r4493435 = b;
        double r4493436 = r4493435 * r4493435;
        double r4493437 = r4493434 + r4493436;
        double r4493438 = 2.0;
        double r4493439 = pow(r4493437, r4493438);
        double r4493440 = 4.0;
        double r4493441 = 1.0;
        double r4493442 = r4493441 + r4493433;
        double r4493443 = r4493434 * r4493442;
        double r4493444 = 3.0;
        double r4493445 = r4493444 * r4493433;
        double r4493446 = r4493441 - r4493445;
        double r4493447 = r4493436 * r4493446;
        double r4493448 = r4493443 + r4493447;
        double r4493449 = r4493440 * r4493448;
        double r4493450 = r4493439 + r4493449;
        double r4493451 = r4493450 - r4493441;
        return r4493451;
}

double f(double a, double b) {
        double r4493452 = 4.0;
        double r4493453 = a;
        double r4493454 = fma(r4493452, r4493453, r4493452);
        double r4493455 = r4493453 * r4493453;
        double r4493456 = b;
        double r4493457 = r4493456 * r4493456;
        double r4493458 = -12.0;
        double r4493459 = fma(r4493453, r4493458, r4493452);
        double r4493460 = fma(r4493453, r4493453, r4493457);
        double r4493461 = -1.0;
        double r4493462 = fma(r4493460, r4493460, r4493461);
        double r4493463 = cbrt(r4493462);
        double r4493464 = r4493463 * r4493463;
        double r4493465 = cbrt(r4493464);
        double r4493466 = cbrt(r4493463);
        double r4493467 = r4493466 * r4493463;
        double r4493468 = r4493465 * r4493467;
        double r4493469 = r4493466 * r4493465;
        double r4493470 = r4493468 * r4493469;
        double r4493471 = fma(r4493457, r4493459, r4493470);
        double r4493472 = fma(r4493454, r4493455, r4493471);
        return r4493472;
}

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(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\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)}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.5

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\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(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}}\right)\right)\]
  5. Using strategy rm
  6. Applied add-cube-cbrt0.5

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\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]{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\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(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}}}\right)\right)\]
  7. Applied cbrt-prod0.6

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\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 \color{blue}{\left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\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)\right)\]
  8. Using strategy rm
  9. Applied add-cube-cbrt0.6

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \left(\sqrt[3]{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\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(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}}} \cdot \sqrt[3]{\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 \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\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)\right)\]
  10. Applied cbrt-prod0.7

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \left(\color{blue}{\left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\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(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right) \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\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)\right)\]
  11. Applied associate-*l*0.6

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \color{blue}{\left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\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 \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\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)\right)\]
  12. Final simplification0.6

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

Reproduce

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