Average Error: 0.2 → 0.1
Time: 27.3s
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) + \mathsf{fma}\left(b, \left(\mathsf{fma}\left(b, b, \left(\left(a \cdot a\right) \cdot 2\right)\right) \cdot b\right), \left({a}^{4}\right)\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) + \mathsf{fma}\left(b, \left(\mathsf{fma}\left(b, b, \left(\left(a \cdot a\right) \cdot 2\right)\right) \cdot b\right), \left({a}^{4}\right)\right)\right) - 1
double f(double a, double b) {
        double r64454751 = a;
        double r64454752 = r64454751 * r64454751;
        double r64454753 = b;
        double r64454754 = r64454753 * r64454753;
        double r64454755 = r64454752 + r64454754;
        double r64454756 = 2.0;
        double r64454757 = pow(r64454755, r64454756);
        double r64454758 = 4.0;
        double r64454759 = r64454758 * r64454754;
        double r64454760 = r64454757 + r64454759;
        double r64454761 = 1.0;
        double r64454762 = r64454760 - r64454761;
        return r64454762;
}

double f(double a, double b) {
        double r64454763 = 4.0;
        double r64454764 = b;
        double r64454765 = r64454764 * r64454764;
        double r64454766 = r64454763 * r64454765;
        double r64454767 = a;
        double r64454768 = r64454767 * r64454767;
        double r64454769 = 2.0;
        double r64454770 = r64454768 * r64454769;
        double r64454771 = fma(r64454764, r64454764, r64454770);
        double r64454772 = r64454771 * r64454764;
        double r64454773 = pow(r64454767, r64454763);
        double r64454774 = fma(r64454764, r64454772, r64454773);
        double r64454775 = r64454766 + r64454774;
        double r64454776 = 1.0;
        double r64454777 = r64454775 - r64454776;
        return r64454777;
}

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}{\mathsf{fma}\left(b, \left(b \cdot \mathsf{fma}\left(b, b, \left(2 \cdot \left(a \cdot a\right)\right)\right)\right), \left(\left(a \cdot a\right) \cdot \left(a \cdot a\right)\right)\right)} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  4. Using strategy rm
  5. Applied pow10.2

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

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

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

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

    \[\leadsto \left(\mathsf{fma}\left(b, \left(b \cdot \mathsf{fma}\left(b, b, \left(2 \cdot \left(a \cdot a\right)\right)\right)\right), \left(\color{blue}{{a}^{\left(1 + 1\right)}} \cdot {a}^{\left(1 + 1\right)}\right)\right) + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  10. Applied pow-sqr0.1

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

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

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

Reproduce

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