Average Error: 0.0 → 0.0
Time: 1.7s
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 r111577 = x;
        double r111578 = y;
        double r111579 = r111577 * r111578;
        double r111580 = z;
        double r111581 = t;
        double r111582 = r111580 * r111581;
        double r111583 = r111579 + r111582;
        double r111584 = a;
        double r111585 = b;
        double r111586 = r111584 * r111585;
        double r111587 = r111583 + r111586;
        return r111587;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r111588 = b;
        double r111589 = a;
        double r111590 = x;
        double r111591 = y;
        double r111592 = z;
        double r111593 = t;
        double r111594 = r111592 * r111593;
        double r111595 = fma(r111590, r111591, r111594);
        double r111596 = fma(r111588, r111589, r111595);
        return r111596;
}

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