Average Error: 0.2 → 0.4
Time: 23.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(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), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \sqrt{\sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right) \cdot \mathsf{fma}\left(a, a, b \cdot b\right)}} \cdot \left(\sqrt{\sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right) \cdot \mathsf{fma}\left(a, a, b \cdot b\right)}} \cdot \sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right)}\right), -1\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), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \sqrt{\sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right) \cdot \mathsf{fma}\left(a, a, b \cdot b\right)}} \cdot \left(\sqrt{\sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right) \cdot \mathsf{fma}\left(a, a, b \cdot b\right)}} \cdot \sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right)}\right), -1\right)\right)\right)
double f(double a, double b) {
        double r5751386 = a;
        double r5751387 = r5751386 * r5751386;
        double r5751388 = b;
        double r5751389 = r5751388 * r5751388;
        double r5751390 = r5751387 + r5751389;
        double r5751391 = 2.0;
        double r5751392 = pow(r5751390, r5751391);
        double r5751393 = 4.0;
        double r5751394 = 1.0;
        double r5751395 = r5751394 + r5751386;
        double r5751396 = r5751387 * r5751395;
        double r5751397 = 3.0;
        double r5751398 = r5751397 * r5751386;
        double r5751399 = r5751394 - r5751398;
        double r5751400 = r5751389 * r5751399;
        double r5751401 = r5751396 + r5751400;
        double r5751402 = r5751393 * r5751401;
        double r5751403 = r5751392 + r5751402;
        double r5751404 = r5751403 - r5751394;
        return r5751404;
}

double f(double a, double b) {
        double r5751405 = 4.0;
        double r5751406 = a;
        double r5751407 = fma(r5751405, r5751406, r5751405);
        double r5751408 = r5751406 * r5751406;
        double r5751409 = b;
        double r5751410 = r5751409 * r5751409;
        double r5751411 = -12.0;
        double r5751412 = fma(r5751406, r5751411, r5751405);
        double r5751413 = fma(r5751406, r5751406, r5751410);
        double r5751414 = r5751413 * r5751413;
        double r5751415 = cbrt(r5751414);
        double r5751416 = sqrt(r5751415);
        double r5751417 = cbrt(r5751413);
        double r5751418 = r5751416 * r5751417;
        double r5751419 = r5751416 * r5751418;
        double r5751420 = -1.0;
        double r5751421 = fma(r5751413, r5751419, r5751420);
        double r5751422 = fma(r5751410, r5751412, r5751421);
        double r5751423 = fma(r5751407, r5751408, r5751422);
        return r5751423;
}

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

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

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

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

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

Reproduce

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