Average Error: 0.2 → 0.2
Time: 23.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\]
\[\sqrt{\mathsf{fma}\left(\mathsf{fma}\left({a}^{2}, 1 - a, \left(3 + a\right) \cdot {b}^{2}\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(3 + a\right) \cdot {b}^{2}\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(3 + a\right)\right)\right) - 1
\sqrt{\mathsf{fma}\left(\mathsf{fma}\left({a}^{2}, 1 - a, \left(3 + a\right) \cdot {b}^{2}\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(3 + a\right) \cdot {b}^{2}\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)} - 1
double f(double a, double b) {
        double r257287 = a;
        double r257288 = r257287 * r257287;
        double r257289 = b;
        double r257290 = r257289 * r257289;
        double r257291 = r257288 + r257290;
        double r257292 = 2.0;
        double r257293 = pow(r257291, r257292);
        double r257294 = 4.0;
        double r257295 = 1.0;
        double r257296 = r257295 - r257287;
        double r257297 = r257288 * r257296;
        double r257298 = 3.0;
        double r257299 = r257298 + r257287;
        double r257300 = r257290 * r257299;
        double r257301 = r257297 + r257300;
        double r257302 = r257294 * r257301;
        double r257303 = r257293 + r257302;
        double r257304 = r257303 - r257295;
        return r257304;
}

double f(double a, double b) {
        double r257305 = a;
        double r257306 = 2.0;
        double r257307 = pow(r257305, r257306);
        double r257308 = 1.0;
        double r257309 = r257308 - r257305;
        double r257310 = 3.0;
        double r257311 = r257310 + r257305;
        double r257312 = b;
        double r257313 = pow(r257312, r257306);
        double r257314 = r257311 * r257313;
        double r257315 = fma(r257307, r257309, r257314);
        double r257316 = 4.0;
        double r257317 = r257312 * r257312;
        double r257318 = fma(r257305, r257305, r257317);
        double r257319 = 2.0;
        double r257320 = pow(r257318, r257319);
        double r257321 = fma(r257315, r257316, r257320);
        double r257322 = sqrt(r257321);
        double r257323 = r257322 * r257322;
        double r257324 = r257323 - r257308;
        return r257324;
}

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. 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(3 + 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(3 + a\right)\right)}} - 1\]
  4. Simplified0.2

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

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

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

Reproduce

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