Average Error: 0.2 → 0.2
Time: 23.6s
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(\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(a, a, b \cdot b\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(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(\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(a, a, b \cdot b\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(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 r105037 = a;
        double r105038 = r105037 * r105037;
        double r105039 = b;
        double r105040 = r105039 * r105039;
        double r105041 = r105038 + r105040;
        double r105042 = 2.0;
        double r105043 = pow(r105041, r105042);
        double r105044 = 4.0;
        double r105045 = 1.0;
        double r105046 = r105045 + r105037;
        double r105047 = r105038 * r105046;
        double r105048 = 3.0;
        double r105049 = r105048 * r105037;
        double r105050 = r105045 - r105049;
        double r105051 = r105040 * r105050;
        double r105052 = r105047 + r105051;
        double r105053 = r105044 * r105052;
        double r105054 = r105043 + r105053;
        double r105055 = r105054 - r105045;
        return r105055;
}

double f(double a, double b) {
        double r105056 = a;
        double r105057 = 2.0;
        double r105058 = pow(r105056, r105057);
        double r105059 = 1.0;
        double r105060 = r105059 + r105056;
        double r105061 = b;
        double r105062 = r105061 * r105061;
        double r105063 = 3.0;
        double r105064 = r105063 * r105056;
        double r105065 = r105059 - r105064;
        double r105066 = r105062 * r105065;
        double r105067 = fma(r105058, r105060, r105066);
        double r105068 = 4.0;
        double r105069 = fma(r105056, r105056, r105062);
        double r105070 = 2.0;
        double r105071 = pow(r105069, r105070);
        double r105072 = fma(r105067, r105068, r105071);
        double r105073 = sqrt(r105072);
        double r105074 = sqrt(r105073);
        double r105075 = r105074 * r105074;
        double r105076 = r105075 * r105073;
        double r105077 = r105076 - r105059;
        return r105077;
}

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-sqr-sqrt0.2

    \[\leadsto \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(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)}}} \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.2

    \[\leadsto \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(a, a, b \cdot b\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(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. Final simplification0.2

    \[\leadsto \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(a, a, b \cdot b\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(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 2019208 +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))