Average Error: 0.2 → 0.1
Time: 41.8s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\left(4 \cdot \left(b \cdot b\right) + (b \cdot \left((b \cdot b + \left(\left(a \cdot a\right) \cdot 2\right))_* \cdot b\right) + \left({a}^{4}\right))_*\right) - 1\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\left(4 \cdot \left(b \cdot b\right) + (b \cdot \left((b \cdot b + \left(\left(a \cdot a\right) \cdot 2\right))_* \cdot b\right) + \left({a}^{4}\right))_*\right) - 1
double f(double a, double b) {
        double r65883504 = a;
        double r65883505 = r65883504 * r65883504;
        double r65883506 = b;
        double r65883507 = r65883506 * r65883506;
        double r65883508 = r65883505 + r65883507;
        double r65883509 = 2.0;
        double r65883510 = pow(r65883508, r65883509);
        double r65883511 = 4.0;
        double r65883512 = r65883511 * r65883507;
        double r65883513 = r65883510 + r65883512;
        double r65883514 = 1.0;
        double r65883515 = r65883513 - r65883514;
        return r65883515;
}

double f(double a, double b) {
        double r65883516 = 4.0;
        double r65883517 = b;
        double r65883518 = r65883517 * r65883517;
        double r65883519 = r65883516 * r65883518;
        double r65883520 = a;
        double r65883521 = r65883520 * r65883520;
        double r65883522 = 2.0;
        double r65883523 = r65883521 * r65883522;
        double r65883524 = fma(r65883517, r65883517, r65883523);
        double r65883525 = r65883524 * r65883517;
        double r65883526 = pow(r65883520, r65883516);
        double r65883527 = fma(r65883517, r65883525, r65883526);
        double r65883528 = r65883519 + r65883527;
        double r65883529 = 1.0;
        double r65883530 = r65883528 - r65883529;
        return r65883530;
}

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(b \cdot b\right)\right) - 1\]
  2. Taylor expanded around 0 0.0

    \[\leadsto \left(\color{blue}{\left({b}^{4} + \left(2 \cdot \left({a}^{2} \cdot {b}^{2}\right) + {a}^{4}\right)\right)} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  3. Simplified0.2

    \[\leadsto \left(\color{blue}{(b \cdot \left(b \cdot (b \cdot b + \left(2 \cdot \left(a \cdot a\right)\right))_*\right) + \left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right))_*} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  4. Using strategy rm
  5. Applied pow10.2

    \[\leadsto \left((b \cdot \left(b \cdot (b \cdot b + \left(2 \cdot \left(a \cdot a\right)\right))_*\right) + \left(\left(a \cdot a\right) \cdot \left(\color{blue}{{a}^{1}} \cdot a\right)\right))_* + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  6. Applied pow-plus0.2

    \[\leadsto \left((b \cdot \left(b \cdot (b \cdot b + \left(2 \cdot \left(a \cdot a\right)\right))_*\right) + \left(\left(a \cdot a\right) \cdot \color{blue}{{a}^{\left(1 + 1\right)}}\right))_* + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  7. Applied pow10.2

    \[\leadsto \left((b \cdot \left(b \cdot (b \cdot b + \left(2 \cdot \left(a \cdot a\right)\right))_*\right) + \left(\left(\color{blue}{{a}^{1}} \cdot a\right) \cdot {a}^{\left(1 + 1\right)}\right))_* + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  8. Applied pow-plus0.2

    \[\leadsto \left((b \cdot \left(b \cdot (b \cdot b + \left(2 \cdot \left(a \cdot a\right)\right))_*\right) + \left(\color{blue}{{a}^{\left(1 + 1\right)}} \cdot {a}^{\left(1 + 1\right)}\right))_* + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  9. Applied pow-sqr0.1

    \[\leadsto \left((b \cdot \left(b \cdot (b \cdot b + \left(2 \cdot \left(a \cdot a\right)\right))_*\right) + \color{blue}{\left({a}^{\left(2 \cdot \left(1 + 1\right)\right)}\right)})_* + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  10. Simplified0.1

    \[\leadsto \left((b \cdot \left(b \cdot (b \cdot b + \left(2 \cdot \left(a \cdot a\right)\right))_*\right) + \left({a}^{\color{blue}{4}}\right))_* + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  11. Final simplification0.1

    \[\leadsto \left(4 \cdot \left(b \cdot b\right) + (b \cdot \left((b \cdot b + \left(\left(a \cdot a\right) \cdot 2\right))_* \cdot b\right) + \left({a}^{4}\right))_*\right) - 1\]

Reproduce

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