Average Error: 0.2 → 0.2
Time: 23.3s
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\]
\[\mathsf{fma}\left(4, \mathsf{fma}\left(b \cdot b, 3, \left(\sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)}\right) \cdot \left(\sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)} \cdot a\right)\right), {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\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
\mathsf{fma}\left(4, \mathsf{fma}\left(b \cdot b, 3, \left(\sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)}\right) \cdot \left(\sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)} \cdot a\right)\right), {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\right)
double f(double a, double b) {
        double r10748473 = a;
        double r10748474 = r10748473 * r10748473;
        double r10748475 = b;
        double r10748476 = r10748475 * r10748475;
        double r10748477 = r10748474 + r10748476;
        double r10748478 = 2.0;
        double r10748479 = pow(r10748477, r10748478);
        double r10748480 = 4.0;
        double r10748481 = 1.0;
        double r10748482 = r10748481 - r10748473;
        double r10748483 = r10748474 * r10748482;
        double r10748484 = 3.0;
        double r10748485 = r10748484 + r10748473;
        double r10748486 = r10748476 * r10748485;
        double r10748487 = r10748483 + r10748486;
        double r10748488 = r10748480 * r10748487;
        double r10748489 = r10748479 + r10748488;
        double r10748490 = r10748489 - r10748481;
        return r10748490;
}

double f(double a, double b) {
        double r10748491 = 4.0;
        double r10748492 = b;
        double r10748493 = r10748492 * r10748492;
        double r10748494 = 3.0;
        double r10748495 = 1.0;
        double r10748496 = a;
        double r10748497 = r10748495 - r10748496;
        double r10748498 = fma(r10748497, r10748496, r10748493);
        double r10748499 = cbrt(r10748498);
        double r10748500 = r10748499 * r10748499;
        double r10748501 = r10748499 * r10748496;
        double r10748502 = r10748500 * r10748501;
        double r10748503 = fma(r10748493, r10748494, r10748502);
        double r10748504 = r10748496 * r10748496;
        double r10748505 = fma(r10748492, r10748492, r10748504);
        double r10748506 = 2.0;
        double r10748507 = pow(r10748505, r10748506);
        double r10748508 = r10748507 - r10748495;
        double r10748509 = fma(r10748491, r10748503, r10748508);
        return r10748509;
}

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

    \[\leadsto \mathsf{fma}\left(4, \mathsf{fma}\left(b \cdot b, 3, \color{blue}{\left(\left(\sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)}\right)} \cdot a\right), {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\right)\]
  5. Applied associate-*l*0.2

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

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

Reproduce

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