Average Error: 0.2 → 0.5
Time: 18.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(4, \mathsf{fma}\left(a, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\right)\right), \left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\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(3 + a\right)\right)\right) - 1
\mathsf{fma}\left(4, \mathsf{fma}\left(a, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\right)\right), \left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right)
double f(double a, double b) {
        double r6361250 = a;
        double r6361251 = r6361250 * r6361250;
        double r6361252 = b;
        double r6361253 = r6361252 * r6361252;
        double r6361254 = r6361251 + r6361253;
        double r6361255 = 2.0;
        double r6361256 = pow(r6361254, r6361255);
        double r6361257 = 4.0;
        double r6361258 = 1.0;
        double r6361259 = r6361258 - r6361250;
        double r6361260 = r6361251 * r6361259;
        double r6361261 = 3.0;
        double r6361262 = r6361261 + r6361250;
        double r6361263 = r6361253 * r6361262;
        double r6361264 = r6361260 + r6361263;
        double r6361265 = r6361257 * r6361264;
        double r6361266 = r6361256 + r6361265;
        double r6361267 = r6361266 - r6361258;
        return r6361267;
}

double f(double a, double b) {
        double r6361268 = 4.0;
        double r6361269 = a;
        double r6361270 = r6361269 * r6361269;
        double r6361271 = r6361269 - r6361270;
        double r6361272 = b;
        double r6361273 = r6361272 * r6361272;
        double r6361274 = 3.0;
        double r6361275 = r6361269 + r6361274;
        double r6361276 = r6361273 * r6361275;
        double r6361277 = fma(r6361269, r6361271, r6361276);
        double r6361278 = fma(r6361269, r6361269, r6361273);
        double r6361279 = -1.0;
        double r6361280 = fma(r6361278, r6361278, r6361279);
        double r6361281 = cbrt(r6361280);
        double r6361282 = r6361281 * r6361281;
        double r6361283 = r6361282 * r6361281;
        double r6361284 = fma(r6361268, r6361277, r6361283);
        return r6361284;
}

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

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

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

Reproduce

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