Average Error: 0.0 → 0.0
Time: 15.8s
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 r132708 = x;
        double r132709 = y;
        double r132710 = r132708 * r132709;
        double r132711 = z;
        double r132712 = t;
        double r132713 = r132711 * r132712;
        double r132714 = r132710 + r132713;
        double r132715 = a;
        double r132716 = b;
        double r132717 = r132715 * r132716;
        double r132718 = r132714 + r132717;
        return r132718;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r132719 = a;
        double r132720 = b;
        double r132721 = x;
        double r132722 = y;
        double r132723 = z;
        double r132724 = t;
        double r132725 = r132723 * r132724;
        double r132726 = fma(r132721, r132722, r132725);
        double r132727 = fma(r132719, r132720, r132726);
        return r132727;
}

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