Average Error: 0.2 → 0.2
Time: 21.7s
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]{\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]{\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]{\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]{\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 r11588273 = a;
        double r11588274 = r11588273 * r11588273;
        double r11588275 = b;
        double r11588276 = r11588275 * r11588275;
        double r11588277 = r11588274 + r11588276;
        double r11588278 = 2.0;
        double r11588279 = pow(r11588277, r11588278);
        double r11588280 = 4.0;
        double r11588281 = 1.0;
        double r11588282 = r11588281 - r11588273;
        double r11588283 = r11588274 * r11588282;
        double r11588284 = 3.0;
        double r11588285 = r11588284 + r11588273;
        double r11588286 = r11588276 * r11588285;
        double r11588287 = r11588283 + r11588286;
        double r11588288 = r11588280 * r11588287;
        double r11588289 = r11588279 + r11588288;
        double r11588290 = r11588289 - r11588281;
        return r11588290;
}

double f(double a, double b) {
        double r11588291 = 3.0;
        double r11588292 = b;
        double r11588293 = r11588292 * r11588292;
        double r11588294 = a;
        double r11588295 = 1.0;
        double r11588296 = r11588295 - r11588294;
        double r11588297 = fma(r11588296, r11588294, r11588293);
        double r11588298 = cbrt(r11588297);
        double r11588299 = cbrt(r11588298);
        double r11588300 = r11588299 * r11588299;
        double r11588301 = r11588300 * r11588299;
        double r11588302 = r11588298 * r11588301;
        double r11588303 = r11588294 * r11588302;
        double r11588304 = r11588303 * r11588298;
        double r11588305 = fma(r11588291, r11588293, r11588304);
        double r11588306 = 4.0;
        double r11588307 = r11588294 * r11588294;
        double r11588308 = fma(r11588292, r11588292, r11588307);
        double r11588309 = 2.0;
        double r11588310 = pow(r11588308, r11588309);
        double r11588311 = fma(r11588305, r11588306, r11588310);
        double r11588312 = r11588311 - r11588295;
        return r11588312;
}

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. Final simplification0.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 \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\]

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