Average Error: 0.0 → 0.0
Time: 5.2s
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 r112603 = x;
        double r112604 = y;
        double r112605 = r112603 * r112604;
        double r112606 = z;
        double r112607 = t;
        double r112608 = r112606 * r112607;
        double r112609 = r112605 + r112608;
        double r112610 = a;
        double r112611 = b;
        double r112612 = r112610 * r112611;
        double r112613 = r112609 + r112612;
        return r112613;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r112614 = a;
        double r112615 = b;
        double r112616 = x;
        double r112617 = y;
        double r112618 = z;
        double r112619 = t;
        double r112620 = r112618 * r112619;
        double r112621 = fma(r112616, r112617, r112620);
        double r112622 = fma(r112614, r112615, r112621);
        return r112622;
}

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