Average Error: 0.0 → 0.0
Time: 2.0s
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 r142559 = x;
        double r142560 = y;
        double r142561 = r142559 * r142560;
        double r142562 = z;
        double r142563 = t;
        double r142564 = r142562 * r142563;
        double r142565 = r142561 + r142564;
        double r142566 = a;
        double r142567 = b;
        double r142568 = r142566 * r142567;
        double r142569 = r142565 + r142568;
        return r142569;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r142570 = a;
        double r142571 = b;
        double r142572 = x;
        double r142573 = y;
        double r142574 = z;
        double r142575 = t;
        double r142576 = r142574 * r142575;
        double r142577 = fma(r142572, r142573, r142576);
        double r142578 = fma(r142570, r142571, r142577);
        return r142578;
}

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