Average Error: 0.0 → 0.0
Time: 7.5s
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 r134516 = x;
        double r134517 = y;
        double r134518 = r134516 * r134517;
        double r134519 = z;
        double r134520 = t;
        double r134521 = r134519 * r134520;
        double r134522 = r134518 + r134521;
        double r134523 = a;
        double r134524 = b;
        double r134525 = r134523 * r134524;
        double r134526 = r134522 + r134525;
        return r134526;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r134527 = a;
        double r134528 = b;
        double r134529 = x;
        double r134530 = y;
        double r134531 = z;
        double r134532 = t;
        double r134533 = r134531 * r134532;
        double r134534 = fma(r134529, r134530, r134533);
        double r134535 = fma(r134527, r134528, r134534);
        return r134535;
}

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