Average Error: 0.2 → 0.5
Time: 53.3s
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[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a \cdot a, a + 1, \left(1 - a \cdot 3\right) \cdot \left(b \cdot b\right)\right), {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a \cdot a, a + 1, \left(1 - a \cdot 3\right) \cdot \left(b \cdot b\right)\right), {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a \cdot a, a + 1, \left(1 - a \cdot 3\right) \cdot \left(b \cdot b\right)\right), {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\right)}\]
\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[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a \cdot a, a + 1, \left(1 - a \cdot 3\right) \cdot \left(b \cdot b\right)\right), {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a \cdot a, a + 1, \left(1 - a \cdot 3\right) \cdot \left(b \cdot b\right)\right), {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(4, \mathsf{fma}\left(a \cdot a, a + 1, \left(1 - a \cdot 3\right) \cdot \left(b \cdot b\right)\right), {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\right)}
double f(double a, double b) {
        double r5032765 = a;
        double r5032766 = r5032765 * r5032765;
        double r5032767 = b;
        double r5032768 = r5032767 * r5032767;
        double r5032769 = r5032766 + r5032768;
        double r5032770 = 2.0;
        double r5032771 = pow(r5032769, r5032770);
        double r5032772 = 4.0;
        double r5032773 = 1.0;
        double r5032774 = r5032773 + r5032765;
        double r5032775 = r5032766 * r5032774;
        double r5032776 = 3.0;
        double r5032777 = r5032776 * r5032765;
        double r5032778 = r5032773 - r5032777;
        double r5032779 = r5032768 * r5032778;
        double r5032780 = r5032775 + r5032779;
        double r5032781 = r5032772 * r5032780;
        double r5032782 = r5032771 + r5032781;
        double r5032783 = r5032782 - r5032773;
        return r5032783;
}

double f(double a, double b) {
        double r5032784 = 4.0;
        double r5032785 = a;
        double r5032786 = r5032785 * r5032785;
        double r5032787 = 1.0;
        double r5032788 = r5032785 + r5032787;
        double r5032789 = 3.0;
        double r5032790 = r5032785 * r5032789;
        double r5032791 = r5032787 - r5032790;
        double r5032792 = b;
        double r5032793 = r5032792 * r5032792;
        double r5032794 = r5032791 * r5032793;
        double r5032795 = fma(r5032786, r5032788, r5032794);
        double r5032796 = fma(r5032792, r5032792, r5032786);
        double r5032797 = 2.0;
        double r5032798 = pow(r5032796, r5032797);
        double r5032799 = r5032798 - r5032787;
        double r5032800 = fma(r5032784, r5032795, r5032799);
        double r5032801 = cbrt(r5032800);
        double r5032802 = r5032801 * r5032801;
        double r5032803 = r5032802 * r5032801;
        return r5032803;
}

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. Simplified0.2

    \[\leadsto \color{blue}{\mathsf{fma}\left(4, \mathsf{fma}\left(a \cdot a, a + 1, \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right), {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\right)}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.5

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

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (25)"
  (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (+ (* (* a a) (+ 1.0 a)) (* (* b b) (- 1.0 (* 3.0 a)))))) 1.0))