Average Error: 0.2 → 0.2
Time: 21.0s
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(\mathsf{fma}\left(3, b \cdot b, \left(a \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)}} \cdot \left(\left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)}} \cdot \sqrt[3]{\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)\right)\right) \cdot \sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)}\right), 4, {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2}\right) - 1\]
\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(\mathsf{fma}\left(3, b \cdot b, \left(a \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)}} \cdot \left(\left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)}} \cdot \sqrt[3]{\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)\right)\right) \cdot \sqrt[3]{\mathsf{fma}\left(1 - a, a, b \cdot b\right)}\right), 4, {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2}\right) - 1
double f(double a, double b) {
        double r12859545 = a;
        double r12859546 = r12859545 * r12859545;
        double r12859547 = b;
        double r12859548 = r12859547 * r12859547;
        double r12859549 = r12859546 + r12859548;
        double r12859550 = 2.0;
        double r12859551 = pow(r12859549, r12859550);
        double r12859552 = 4.0;
        double r12859553 = 1.0;
        double r12859554 = r12859553 - r12859545;
        double r12859555 = r12859546 * r12859554;
        double r12859556 = 3.0;
        double r12859557 = r12859556 + r12859545;
        double r12859558 = r12859548 * r12859557;
        double r12859559 = r12859555 + r12859558;
        double r12859560 = r12859552 * r12859559;
        double r12859561 = r12859551 + r12859560;
        double r12859562 = r12859561 - r12859553;
        return r12859562;
}

double f(double a, double b) {
        double r12859563 = 3.0;
        double r12859564 = b;
        double r12859565 = r12859564 * r12859564;
        double r12859566 = a;
        double r12859567 = 1.0;
        double r12859568 = r12859567 - r12859566;
        double r12859569 = fma(r12859568, r12859566, r12859565);
        double r12859570 = cbrt(r12859569);
        double r12859571 = cbrt(r12859570);
        double r12859572 = r12859571 * r12859571;
        double r12859573 = r12859572 * r12859570;
        double r12859574 = r12859571 * r12859573;
        double r12859575 = r12859566 * r12859574;
        double r12859576 = r12859575 * r12859570;
        double r12859577 = fma(r12859563, r12859565, r12859576);
        double r12859578 = 4.0;
        double r12859579 = r12859566 * r12859566;
        double r12859580 = fma(r12859564, r12859564, r12859579);
        double r12859581 = 2.0;
        double r12859582 = pow(r12859580, r12859581);
        double r12859583 = fma(r12859577, r12859578, r12859582);
        double r12859584 = r12859583 - r12859567;
        return r12859584;
}

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

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(3, b \cdot b, a \cdot \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)}\right), 4, {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2}\right) - 1\]
  5. Applied associate-*r*0.2

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

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

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

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

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))