Average Error: 0.0 → 0.0
Time: 4.3s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r129612 = x;
        double r129613 = y;
        double r129614 = r129612 * r129613;
        double r129615 = z;
        double r129616 = t;
        double r129617 = r129615 * r129616;
        double r129618 = r129614 + r129617;
        double r129619 = a;
        double r129620 = b;
        double r129621 = r129619 * r129620;
        double r129622 = r129618 + r129621;
        return r129622;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r129623 = a;
        double r129624 = b;
        double r129625 = x;
        double r129626 = y;
        double r129627 = z;
        double r129628 = t;
        double r129629 = r129627 * r129628;
        double r129630 = fma(r129625, r129626, r129629);
        double r129631 = fma(r129623, r129624, r129630);
        return r129631;
}

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(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019350 +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)))