Average Error: 0.2 → 0.4
Time: 23.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(1 - 3 \cdot a\right)\right)\right) - 1\]
\[\mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right) \cdot \mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right)}}\right), -1\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(1 - 3 \cdot a\right)\right)\right) - 1
\mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right) \cdot \mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right)}}\right), -1\right)\right)\right)
double f(double a, double b) {
        double r12169016 = a;
        double r12169017 = r12169016 * r12169016;
        double r12169018 = b;
        double r12169019 = r12169018 * r12169018;
        double r12169020 = r12169017 + r12169019;
        double r12169021 = 2.0;
        double r12169022 = pow(r12169020, r12169021);
        double r12169023 = 4.0;
        double r12169024 = 1.0;
        double r12169025 = r12169024 + r12169016;
        double r12169026 = r12169017 * r12169025;
        double r12169027 = 3.0;
        double r12169028 = r12169027 * r12169016;
        double r12169029 = r12169024 - r12169028;
        double r12169030 = r12169019 * r12169029;
        double r12169031 = r12169026 + r12169030;
        double r12169032 = r12169023 * r12169031;
        double r12169033 = r12169022 + r12169032;
        double r12169034 = r12169033 - r12169024;
        return r12169034;
}

double f(double a, double b) {
        double r12169035 = 4.0;
        double r12169036 = a;
        double r12169037 = fma(r12169035, r12169036, r12169035);
        double r12169038 = r12169036 * r12169036;
        double r12169039 = b;
        double r12169040 = r12169039 * r12169039;
        double r12169041 = -12.0;
        double r12169042 = fma(r12169036, r12169041, r12169035);
        double r12169043 = fma(r12169036, r12169036, r12169040);
        double r12169044 = r12169043 * r12169043;
        double r12169045 = cbrt(r12169044);
        double r12169046 = cbrt(r12169043);
        double r12169047 = cbrt(r12169046);
        double r12169048 = r12169046 * r12169046;
        double r12169049 = cbrt(r12169048);
        double r12169050 = r12169047 * r12169049;
        double r12169051 = r12169045 * r12169050;
        double r12169052 = -1.0;
        double r12169053 = fma(r12169043, r12169051, r12169052);
        double r12169054 = fma(r12169040, r12169042, r12169053);
        double r12169055 = fma(r12169037, r12169038, r12169054);
        return r12169055;
}

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. Simplified0.2

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

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

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

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right) \cdot \mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt[3]{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(a, a, b \cdot b\right)}}}, -1\right)\right)\right)\]
  9. Applied cbrt-prod0.4

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

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

Reproduce

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