Average Error: 0.2 → 0.3
Time: 25.7s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\left(\sqrt{\sqrt[3]{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}} \cdot \sqrt{\sqrt[3]{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}}\right) \cdot \sqrt{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)} - 1\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\left(\sqrt{\sqrt[3]{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}} \cdot \sqrt{\sqrt[3]{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}}\right) \cdot \sqrt{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)} - 1
double f(double a, double b) {
        double r13661374 = a;
        double r13661375 = r13661374 * r13661374;
        double r13661376 = b;
        double r13661377 = r13661376 * r13661376;
        double r13661378 = r13661375 + r13661377;
        double r13661379 = 2.0;
        double r13661380 = pow(r13661378, r13661379);
        double r13661381 = 4.0;
        double r13661382 = r13661381 * r13661377;
        double r13661383 = r13661380 + r13661382;
        double r13661384 = 1.0;
        double r13661385 = r13661383 - r13661384;
        return r13661385;
}

double f(double a, double b) {
        double r13661386 = 4.0;
        double r13661387 = b;
        double r13661388 = r13661387 * r13661387;
        double r13661389 = a;
        double r13661390 = fma(r13661389, r13661389, r13661388);
        double r13661391 = 2.0;
        double r13661392 = pow(r13661390, r13661391);
        double r13661393 = fma(r13661386, r13661388, r13661392);
        double r13661394 = cbrt(r13661393);
        double r13661395 = r13661394 * r13661394;
        double r13661396 = sqrt(r13661395);
        double r13661397 = sqrt(r13661394);
        double r13661398 = r13661396 * r13661397;
        double r13661399 = sqrt(r13661393);
        double r13661400 = r13661398 * r13661399;
        double r13661401 = 1.0;
        double r13661402 = r13661400 - r13661401;
        return r13661402;
}

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(b \cdot b\right)\right) - 1\]
  2. Simplified0.2

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

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

    \[\leadsto \sqrt{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)} \cdot \sqrt{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(4, b \cdot b, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}}} - 1\]
  7. Applied sqrt-prod0.3

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (26)"
  (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (* b b))) 1.0))