Average Error: 0.0 → 0.0
Time: 1.7s
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 r138178 = x;
        double r138179 = y;
        double r138180 = r138178 * r138179;
        double r138181 = z;
        double r138182 = t;
        double r138183 = r138181 * r138182;
        double r138184 = r138180 + r138183;
        double r138185 = a;
        double r138186 = b;
        double r138187 = r138185 * r138186;
        double r138188 = r138184 + r138187;
        return r138188;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r138189 = t;
        double r138190 = z;
        double r138191 = a;
        double r138192 = b;
        double r138193 = x;
        double r138194 = y;
        double r138195 = r138193 * r138194;
        double r138196 = fma(r138191, r138192, r138195);
        double r138197 = fma(r138189, r138190, r138196);
        return r138197;
}

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 2020021 +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)))