Average Error: 0.2 → 0.3
Time: 26.4s
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(1 - 3 \cdot a\right)\right)\right) - 1\]
\[\left(\left|\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left({a}^{2}, 1 + a, \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}\right| \cdot \sqrt{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left({a}^{2}, 1 + a, \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}}\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left({a}^{2}, 1 + a, \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\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(1 - 3 \cdot a\right)\right)\right) - 1
\left(\left|\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left({a}^{2}, 1 + a, \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}\right| \cdot \sqrt{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left({a}^{2}, 1 + a, \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}}\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left({a}^{2}, 1 + a, \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)} - 1
double f(double a, double b) {
        double r192158 = a;
        double r192159 = r192158 * r192158;
        double r192160 = b;
        double r192161 = r192160 * r192160;
        double r192162 = r192159 + r192161;
        double r192163 = 2.0;
        double r192164 = pow(r192162, r192163);
        double r192165 = 4.0;
        double r192166 = 1.0;
        double r192167 = r192166 + r192158;
        double r192168 = r192159 * r192167;
        double r192169 = 3.0;
        double r192170 = r192169 * r192158;
        double r192171 = r192166 - r192170;
        double r192172 = r192161 * r192171;
        double r192173 = r192168 + r192172;
        double r192174 = r192165 * r192173;
        double r192175 = r192164 + r192174;
        double r192176 = r192175 - r192166;
        return r192176;
}

double f(double a, double b) {
        double r192177 = a;
        double r192178 = 2.0;
        double r192179 = pow(r192177, r192178);
        double r192180 = 1.0;
        double r192181 = r192180 + r192177;
        double r192182 = b;
        double r192183 = r192182 * r192182;
        double r192184 = 3.0;
        double r192185 = r192184 * r192177;
        double r192186 = r192180 - r192185;
        double r192187 = r192183 * r192186;
        double r192188 = fma(r192179, r192181, r192187);
        double r192189 = 4.0;
        double r192190 = fma(r192177, r192177, r192183);
        double r192191 = 2.0;
        double r192192 = pow(r192190, r192191);
        double r192193 = fma(r192188, r192189, r192192);
        double r192194 = cbrt(r192193);
        double r192195 = fabs(r192194);
        double r192196 = sqrt(r192194);
        double r192197 = r192195 * r192196;
        double r192198 = sqrt(r192193);
        double r192199 = r192197 * r192198;
        double r192200 = r192199 - r192180;
        return r192200;
}

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(1 - 3 \cdot a\right)\right)\right) - 1\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt0.2

    \[\leadsto \color{blue}{\sqrt{{\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(1 - 3 \cdot a\right)\right)} \cdot \sqrt{{\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(1 - 3 \cdot a\right)\right)}} - 1\]
  4. Simplified0.2

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

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

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

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

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

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

Reproduce

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