Average Error: 0.2 → 0.6
Time: 25.3s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\mathsf{fma}\left(b \cdot b, 4, \left(\left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(b, b, a \cdot a\right), \mathsf{fma}\left(b, b, a \cdot a\right), -1\right)} \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(b, b, a \cdot a\right), \mathsf{fma}\left(b, b, a \cdot a\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(b, b, a \cdot a\right), \mathsf{fma}\left(b, b, a \cdot a\right), -1\right)}}\right)\right) \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(b, b, a \cdot a\right), \mathsf{fma}\left(b, b, a \cdot a\right), -1\right)}}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(b, b, a \cdot a\right), \mathsf{fma}\left(b, b, a \cdot a\right), -1\right)}\right)\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\mathsf{fma}\left(b \cdot b, 4, \left(\left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(b, b, a \cdot a\right), \mathsf{fma}\left(b, b, a \cdot a\right), -1\right)} \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(b, b, a \cdot a\right), \mathsf{fma}\left(b, b, a \cdot a\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(b, b, a \cdot a\right), \mathsf{fma}\left(b, b, a \cdot a\right), -1\right)}}\right)\right) \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(b, b, a \cdot a\right), \mathsf{fma}\left(b, b, a \cdot a\right), -1\right)}}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(b, b, a \cdot a\right), \mathsf{fma}\left(b, b, a \cdot a\right), -1\right)}\right)
double f(double a, double b) {
        double r8885175 = a;
        double r8885176 = r8885175 * r8885175;
        double r8885177 = b;
        double r8885178 = r8885177 * r8885177;
        double r8885179 = r8885176 + r8885178;
        double r8885180 = 2.0;
        double r8885181 = pow(r8885179, r8885180);
        double r8885182 = 4.0;
        double r8885183 = r8885182 * r8885178;
        double r8885184 = r8885181 + r8885183;
        double r8885185 = 1.0;
        double r8885186 = r8885184 - r8885185;
        return r8885186;
}

double f(double a, double b) {
        double r8885187 = b;
        double r8885188 = r8885187 * r8885187;
        double r8885189 = 4.0;
        double r8885190 = a;
        double r8885191 = r8885190 * r8885190;
        double r8885192 = fma(r8885187, r8885187, r8885191);
        double r8885193 = -1.0;
        double r8885194 = fma(r8885192, r8885192, r8885193);
        double r8885195 = cbrt(r8885194);
        double r8885196 = cbrt(r8885195);
        double r8885197 = r8885196 * r8885196;
        double r8885198 = r8885195 * r8885197;
        double r8885199 = r8885198 * r8885196;
        double r8885200 = r8885199 * r8885195;
        double r8885201 = fma(r8885188, r8885189, r8885200);
        return r8885201;
}

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

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

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

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

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (26)"
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (* b b))) 1))