Average Error: 0.2 → 0.6
Time: 22.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(a, a - a \cdot a, \left(b \cdot b\right) \cdot \left(a + 3\right)\right), \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 \left(\sqrt[3]{\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 \left(\sqrt[3]{\left(\sqrt[3]{\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]{\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 \left(\sqrt[3]{\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)\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), \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 \left(\sqrt[3]{\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 \left(\sqrt[3]{\left(\sqrt[3]{\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]{\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 \left(\sqrt[3]{\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)\right)\right)
double f(double a, double b) {
        double r7369020 = a;
        double r7369021 = r7369020 * r7369020;
        double r7369022 = b;
        double r7369023 = r7369022 * r7369022;
        double r7369024 = r7369021 + r7369023;
        double r7369025 = 2.0;
        double r7369026 = pow(r7369024, r7369025);
        double r7369027 = 4.0;
        double r7369028 = 1.0;
        double r7369029 = r7369028 - r7369020;
        double r7369030 = r7369021 * r7369029;
        double r7369031 = 3.0;
        double r7369032 = r7369031 + r7369020;
        double r7369033 = r7369023 * r7369032;
        double r7369034 = r7369030 + r7369033;
        double r7369035 = r7369027 * r7369034;
        double r7369036 = r7369026 + r7369035;
        double r7369037 = r7369036 - r7369028;
        return r7369037;
}

double f(double a, double b) {
        double r7369038 = 4.0;
        double r7369039 = a;
        double r7369040 = r7369039 * r7369039;
        double r7369041 = r7369039 - r7369040;
        double r7369042 = b;
        double r7369043 = r7369042 * r7369042;
        double r7369044 = 3.0;
        double r7369045 = r7369039 + r7369044;
        double r7369046 = r7369043 * r7369045;
        double r7369047 = fma(r7369039, r7369041, r7369046);
        double r7369048 = fma(r7369039, r7369039, r7369043);
        double r7369049 = -1.0;
        double r7369050 = fma(r7369048, r7369048, r7369049);
        double r7369051 = cbrt(r7369050);
        double r7369052 = cbrt(r7369051);
        double r7369053 = r7369052 * r7369052;
        double r7369054 = r7369052 * r7369051;
        double r7369055 = r7369053 * r7369054;
        double r7369056 = cbrt(r7369055);
        double r7369057 = r7369056 * r7369051;
        double r7369058 = r7369052 * r7369057;
        double r7369059 = r7369051 * r7369058;
        double r7369060 = fma(r7369038, r7369047, r7369059);
        return r7369060;
}

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. Using strategy rm
  6. 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), \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]{\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) \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)\]
  7. Applied cbrt-prod0.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), \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 \color{blue}{\left(\sqrt[3]{\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)}} \cdot \sqrt[3]{\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)}\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)\]
  8. Applied associate-*r*0.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(\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]{\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]{\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)\]
  9. Using strategy rm
  10. Applied add-cube-cbrt0.6

    \[\leadsto \mathsf{fma}\left(4, \mathsf{fma}\left(a, a - a \cdot a, \left(a + 3\right) \cdot \left(b \cdot b\right)\right), \left(\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]{\color{blue}{\left(\left(\sqrt[3]{\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]{\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]{\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) \cdot \sqrt[3]{\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)\]
  11. Applied associate-*l*0.6

    \[\leadsto \mathsf{fma}\left(4, \mathsf{fma}\left(a, a - a \cdot a, \left(a + 3\right) \cdot \left(b \cdot b\right)\right), \left(\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]{\color{blue}{\left(\sqrt[3]{\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]{\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 \left(\sqrt[3]{\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)}}\right) \cdot \sqrt[3]{\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)\]
  12. Final simplification0.6

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

Reproduce

herbie shell --seed 2019142 +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))