Average Error: 0.2 → 0.9
Time: 3.9s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\mathsf{fma}\left(b, b \cdot \mathsf{fma}\left(b, b, 2 \cdot {a}^{2}\right), {a}^{4}\right) - 1\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\mathsf{fma}\left(b, b \cdot \mathsf{fma}\left(b, b, 2 \cdot {a}^{2}\right), {a}^{4}\right) - 1
double f(double a, double b) {
        double r389850 = a;
        double r389851 = r389850 * r389850;
        double r389852 = b;
        double r389853 = r389852 * r389852;
        double r389854 = r389851 + r389853;
        double r389855 = 2.0;
        double r389856 = pow(r389854, r389855);
        double r389857 = 4.0;
        double r389858 = r389857 * r389853;
        double r389859 = r389856 + r389858;
        double r389860 = 1.0;
        double r389861 = r389859 - r389860;
        return r389861;
}

double f(double a, double b) {
        double r389862 = b;
        double r389863 = 2.0;
        double r389864 = a;
        double r389865 = pow(r389864, r389863);
        double r389866 = r389863 * r389865;
        double r389867 = fma(r389862, r389862, r389866);
        double r389868 = r389862 * r389867;
        double r389869 = 4.0;
        double r389870 = pow(r389864, r389869);
        double r389871 = fma(r389862, r389868, r389870);
        double r389872 = 1.0;
        double r389873 = r389871 - r389872;
        return r389873;
}

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 inf 0.9

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

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

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

Reproduce

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