Average Error: 0.2 → 0.2
Time: 22.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(1 - 3 \cdot a\right)\right)\right) - 1\]
\[\sqrt{\mathsf{fma}\left(\mathsf{fma}\left({a}^{2}, 1 + a, \left(1 - 3 \cdot a\right) \cdot \left(b \cdot b\right)\right), 4, {\left(\mathsf{fma}\left(b, b, {a}^{2}\right)\right)}^{2}\right)} \cdot \left(\sqrt{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(b \cdot \mathsf{fma}\left(a, -3, 1\right), 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}\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(b \cdot \mathsf{fma}\left(a, -3, 1\right), 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}\right)}}\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
\sqrt{\mathsf{fma}\left(\mathsf{fma}\left({a}^{2}, 1 + a, \left(1 - 3 \cdot a\right) \cdot \left(b \cdot b\right)\right), 4, {\left(\mathsf{fma}\left(b, b, {a}^{2}\right)\right)}^{2}\right)} \cdot \left(\sqrt{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(b \cdot \mathsf{fma}\left(a, -3, 1\right), 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}\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(b \cdot \mathsf{fma}\left(a, -3, 1\right), 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}\right)}}\right) - 1
double f(double a, double b) {
        double r207027 = a;
        double r207028 = r207027 * r207027;
        double r207029 = b;
        double r207030 = r207029 * r207029;
        double r207031 = r207028 + r207030;
        double r207032 = 2.0;
        double r207033 = pow(r207031, r207032);
        double r207034 = 4.0;
        double r207035 = 1.0;
        double r207036 = r207035 + r207027;
        double r207037 = r207028 * r207036;
        double r207038 = 3.0;
        double r207039 = r207038 * r207027;
        double r207040 = r207035 - r207039;
        double r207041 = r207030 * r207040;
        double r207042 = r207037 + r207041;
        double r207043 = r207034 * r207042;
        double r207044 = r207033 + r207043;
        double r207045 = r207044 - r207035;
        return r207045;
}

double f(double a, double b) {
        double r207046 = a;
        double r207047 = 2.0;
        double r207048 = pow(r207046, r207047);
        double r207049 = 1.0;
        double r207050 = r207049 + r207046;
        double r207051 = 3.0;
        double r207052 = r207051 * r207046;
        double r207053 = r207049 - r207052;
        double r207054 = b;
        double r207055 = r207054 * r207054;
        double r207056 = r207053 * r207055;
        double r207057 = fma(r207048, r207050, r207056);
        double r207058 = 4.0;
        double r207059 = fma(r207054, r207054, r207048);
        double r207060 = 2.0;
        double r207061 = pow(r207059, r207060);
        double r207062 = fma(r207057, r207058, r207061);
        double r207063 = sqrt(r207062);
        double r207064 = -r207051;
        double r207065 = fma(r207046, r207064, r207049);
        double r207066 = r207054 * r207065;
        double r207067 = r207046 * r207046;
        double r207068 = r207050 * r207067;
        double r207069 = fma(r207066, r207054, r207068);
        double r207070 = fma(r207054, r207054, r207067);
        double r207071 = pow(r207070, r207060);
        double r207072 = fma(r207069, r207058, r207071);
        double r207073 = sqrt(r207072);
        double r207074 = sqrt(r207073);
        double r207075 = r207074 * r207074;
        double r207076 = r207063 * r207075;
        double r207077 = r207076 - r207049;
        return r207077;
}

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(b, b, {a}^{2}\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(b, b, {a}^{2}\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(b, b, {a}^{2}\right)\right)}^{2}\right)}} - 1\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt0.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(b, b, {a}^{2}\right)\right)}^{2}\right)} \cdot \sqrt{\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(b, b, {a}^{2}\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(b, b, {a}^{2}\right)\right)}^{2}\right)}}} - 1\]
  8. Applied sqrt-prod0.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(b, b, {a}^{2}\right)\right)}^{2}\right)} \cdot \color{blue}{\left(\sqrt{\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(b, b, {a}^{2}\right)\right)}^{2}\right)}} \cdot \sqrt{\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(b, b, {a}^{2}\right)\right)}^{2}\right)}}\right)} - 1\]
  9. 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(b, b, {a}^{2}\right)\right)}^{2}\right)} \cdot \left(\color{blue}{\sqrt{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a, -3, 1\right) \cdot b, b, \left(a + 1\right) \cdot \left(a \cdot a\right)\right), 4, {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2}\right)}}} \cdot \sqrt{\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(b, b, {a}^{2}\right)\right)}^{2}\right)}}\right) - 1\]
  10. 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(b, b, {a}^{2}\right)\right)}^{2}\right)} \cdot \left(\sqrt{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a, -3, 1\right) \cdot b, b, \left(a + 1\right) \cdot \left(a \cdot a\right)\right), 4, {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2}\right)}} \cdot \color{blue}{\sqrt{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a, -3, 1\right) \cdot b, b, \left(a + 1\right) \cdot \left(a \cdot a\right)\right), 4, {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2}\right)}}}\right) - 1\]
  11. Final simplification0.2

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

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (25)"
  (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (+ (* (* a a) (+ 1.0 a)) (* (* b b) (- 1.0 (* 3.0 a)))))) 1.0))