Average Error: 0.0 → 0.0
Time: 2.1s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r119047 = x;
        double r119048 = y;
        double r119049 = r119047 * r119048;
        double r119050 = z;
        double r119051 = t;
        double r119052 = r119050 * r119051;
        double r119053 = r119049 + r119052;
        double r119054 = a;
        double r119055 = b;
        double r119056 = r119054 * r119055;
        double r119057 = r119053 + r119056;
        return r119057;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r119058 = t;
        double r119059 = z;
        double r119060 = a;
        double r119061 = b;
        double r119062 = x;
        double r119063 = y;
        double r119064 = r119062 * r119063;
        double r119065 = fma(r119060, r119061, r119064);
        double r119066 = fma(r119058, r119059, r119065);
        return r119066;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Derivation

  1. Initial program 0.0

    \[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)}\]
  3. Taylor expanded around inf 0.0

    \[\leadsto \color{blue}{t \cdot z + \left(a \cdot b + x \cdot y\right)}\]
  4. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)}\]
  5. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\]

Reproduce

herbie shell --seed 2020001 +o rules:numerics
(FPCore (x y z t a b)
  :name "Linear.V3:$cdot from linear-1.19.1.3, B"
  :precision binary64
  (+ (+ (* x y) (* z t)) (* a b)))