Average Error: 0.0 → 0.0
Time: 3.2s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r122757 = x;
        double r122758 = y;
        double r122759 = r122757 * r122758;
        double r122760 = z;
        double r122761 = t;
        double r122762 = r122760 * r122761;
        double r122763 = r122759 + r122762;
        double r122764 = a;
        double r122765 = b;
        double r122766 = r122764 * r122765;
        double r122767 = r122763 + r122766;
        return r122767;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r122768 = t;
        double r122769 = z;
        double r122770 = a;
        double r122771 = b;
        double r122772 = x;
        double r122773 = y;
        double r122774 = r122772 * r122773;
        double r122775 = fma(r122770, r122771, r122774);
        double r122776 = fma(r122768, r122769, r122775);
        return r122776;
}

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. Taylor expanded around inf 0.0

    \[\leadsto \color{blue}{t \cdot z + \left(a \cdot b + x \cdot y\right)}\]
  4. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)}\]
  5. Final simplification0.0

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

Reproduce

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