Average Error: 0.2 → 0.0
Time: 18.7s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\left({\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{4} + \left(b \cdot b\right) \cdot 4\right) - 1\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\left({\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{4} + \left(b \cdot b\right) \cdot 4\right) - 1
double f(double a, double b) {
        double r10942560 = a;
        double r10942561 = r10942560 * r10942560;
        double r10942562 = b;
        double r10942563 = r10942562 * r10942562;
        double r10942564 = r10942561 + r10942563;
        double r10942565 = 2.0;
        double r10942566 = pow(r10942564, r10942565);
        double r10942567 = 4.0;
        double r10942568 = r10942567 * r10942563;
        double r10942569 = r10942566 + r10942568;
        double r10942570 = 1.0;
        double r10942571 = r10942569 - r10942570;
        return r10942571;
}

double f(double a, double b) {
        double r10942572 = a;
        double r10942573 = b;
        double r10942574 = r10942573 * r10942573;
        double r10942575 = fma(r10942572, r10942572, r10942574);
        double r10942576 = sqrt(r10942575);
        double r10942577 = 4.0;
        double r10942578 = pow(r10942576, r10942577);
        double r10942579 = r10942574 * r10942577;
        double r10942580 = r10942578 + r10942579;
        double r10942581 = 1.0;
        double r10942582 = r10942580 - r10942581;
        return r10942582;
}

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. Using strategy rm
  3. Applied *-un-lft-identity0.2

    \[\leadsto \left({\color{blue}{\left(1 \cdot \left(a \cdot a + b \cdot b\right)\right)}}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  4. Applied unpow-prod-down0.2

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

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

    \[\leadsto \left(1 \cdot \color{blue}{\left(\mathsf{fma}\left(a, a, b \cdot b\right) \cdot \mathsf{fma}\left(a, a, b \cdot b\right)\right)} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  7. Using strategy rm
  8. Applied add-sqr-sqrt0.2

    \[\leadsto \left(1 \cdot \left(\mathsf{fma}\left(a, a, b \cdot b\right) \cdot \color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}\right) + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  9. Applied associate-*r*0.1

    \[\leadsto \left(1 \cdot \color{blue}{\left(\left(\mathsf{fma}\left(a, a, b \cdot b\right) \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right) \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  10. Using strategy rm
  11. Applied pow10.1

    \[\leadsto \left(1 \cdot \left(\left(\mathsf{fma}\left(a, a, b \cdot b\right) \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right) \cdot \color{blue}{{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{1}}\right) + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  12. Applied add-sqr-sqrt0.1

    \[\leadsto \left(1 \cdot \left(\left(\color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right) \cdot {\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{1}\right) + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  13. Applied pow30.1

    \[\leadsto \left(1 \cdot \left(\color{blue}{{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{3}} \cdot {\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{1}\right) + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  14. Applied pow-prod-up0.0

    \[\leadsto \left(1 \cdot \color{blue}{{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{\left(3 + 1\right)}} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  15. Simplified0.0

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

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

Reproduce

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