Average Error: 0.0 → 0.0
Time: 3.5s
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 r200984 = x;
        double r200985 = y;
        double r200986 = r200984 * r200985;
        double r200987 = z;
        double r200988 = t;
        double r200989 = r200987 * r200988;
        double r200990 = r200986 + r200989;
        double r200991 = a;
        double r200992 = b;
        double r200993 = r200991 * r200992;
        double r200994 = r200990 + r200993;
        return r200994;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r200995 = t;
        double r200996 = z;
        double r200997 = a;
        double r200998 = b;
        double r200999 = x;
        double r201000 = y;
        double r201001 = r200999 * r201000;
        double r201002 = fma(r200997, r200998, r201001);
        double r201003 = fma(r200995, r200996, r201002);
        return r201003;
}

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