Average Error: 0.2 → 0.2
Time: 53.9s
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(\left(\sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)}, 4, {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\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(\left(\sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)}, 4, {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\right)
double f(double a, double b) {
        double r10359974 = a;
        double r10359975 = r10359974 * r10359974;
        double r10359976 = b;
        double r10359977 = r10359976 * r10359976;
        double r10359978 = r10359975 + r10359977;
        double r10359979 = 2.0;
        double r10359980 = pow(r10359978, r10359979);
        double r10359981 = 4.0;
        double r10359982 = 1.0;
        double r10359983 = r10359982 - r10359974;
        double r10359984 = r10359975 * r10359983;
        double r10359985 = 3.0;
        double r10359986 = r10359985 + r10359974;
        double r10359987 = r10359977 * r10359986;
        double r10359988 = r10359984 + r10359987;
        double r10359989 = r10359981 * r10359988;
        double r10359990 = r10359980 + r10359989;
        double r10359991 = r10359990 - r10359982;
        return r10359991;
}

double f(double a, double b) {
        double r10359992 = 3.0;
        double r10359993 = a;
        double r10359994 = r10359992 + r10359993;
        double r10359995 = b;
        double r10359996 = r10359995 * r10359995;
        double r10359997 = r10359993 * r10359993;
        double r10359998 = 1.0;
        double r10359999 = r10359998 - r10359993;
        double r10360000 = r10359997 * r10359999;
        double r10360001 = fma(r10359994, r10359996, r10360000);
        double r10360002 = cbrt(r10360001);
        double r10360003 = r10360002 * r10360002;
        double r10360004 = r10360003 * r10360002;
        double r10360005 = 4.0;
        double r10360006 = fma(r10359995, r10359995, r10359997);
        double r10360007 = 2.0;
        double r10360008 = pow(r10360006, r10360007);
        double r10360009 = r10360008 - r10359998;
        double r10360010 = fma(r10360004, r10360005, r10360009);
        return r10360010;
}

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

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

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

Reproduce

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