Average Error: 0.2 → 0.5
Time: 20.0s
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\]
\[\mathsf{fma}\left(\mathsf{fma}\left(a, a \cdot \left(1 - a\right), \left(b \cdot b\right) \cdot \left(a + 3\right)\right), 4, \left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\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(3 + a\right)\right)\right) - 1
\mathsf{fma}\left(\mathsf{fma}\left(a, a \cdot \left(1 - a\right), \left(b \cdot b\right) \cdot \left(a + 3\right)\right), 4, \left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right)
double f(double a, double b) {
        double r3978111 = a;
        double r3978112 = r3978111 * r3978111;
        double r3978113 = b;
        double r3978114 = r3978113 * r3978113;
        double r3978115 = r3978112 + r3978114;
        double r3978116 = 2.0;
        double r3978117 = pow(r3978115, r3978116);
        double r3978118 = 4.0;
        double r3978119 = 1.0;
        double r3978120 = r3978119 - r3978111;
        double r3978121 = r3978112 * r3978120;
        double r3978122 = 3.0;
        double r3978123 = r3978122 + r3978111;
        double r3978124 = r3978114 * r3978123;
        double r3978125 = r3978121 + r3978124;
        double r3978126 = r3978118 * r3978125;
        double r3978127 = r3978117 + r3978126;
        double r3978128 = r3978127 - r3978119;
        return r3978128;
}

double f(double a, double b) {
        double r3978129 = a;
        double r3978130 = 1.0;
        double r3978131 = r3978130 - r3978129;
        double r3978132 = r3978129 * r3978131;
        double r3978133 = b;
        double r3978134 = r3978133 * r3978133;
        double r3978135 = 3.0;
        double r3978136 = r3978129 + r3978135;
        double r3978137 = r3978134 * r3978136;
        double r3978138 = fma(r3978129, r3978132, r3978137);
        double r3978139 = 4.0;
        double r3978140 = fma(r3978129, r3978129, r3978134);
        double r3978141 = -1.0;
        double r3978142 = fma(r3978140, r3978140, r3978141);
        double r3978143 = cbrt(r3978142);
        double r3978144 = r3978143 * r3978143;
        double r3978145 = r3978144 * r3978143;
        double r3978146 = fma(r3978138, r3978139, r3978145);
        return r3978146;
}

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

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

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

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

Reproduce

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