Average Error: 0.0 → 0.0
Time: 1.4s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(b, a, \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 r109419 = x;
        double r109420 = y;
        double r109421 = r109419 * r109420;
        double r109422 = z;
        double r109423 = t;
        double r109424 = r109422 * r109423;
        double r109425 = r109421 + r109424;
        double r109426 = a;
        double r109427 = b;
        double r109428 = r109426 * r109427;
        double r109429 = r109425 + r109428;
        return r109429;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r109430 = b;
        double r109431 = a;
        double r109432 = x;
        double r109433 = y;
        double r109434 = z;
        double r109435 = t;
        double r109436 = r109434 * r109435;
        double r109437 = fma(r109432, r109433, r109436);
        double r109438 = fma(r109430, r109431, r109437);
        return r109438;
}

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. Final simplification0.0

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

Reproduce

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