Average Error: 0.0 → 0.0
Time: 3.3s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, x \cdot y\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, x \cdot y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r133871 = x;
        double r133872 = y;
        double r133873 = r133871 * r133872;
        double r133874 = z;
        double r133875 = t;
        double r133876 = r133874 * r133875;
        double r133877 = r133873 + r133876;
        double r133878 = a;
        double r133879 = b;
        double r133880 = r133878 * r133879;
        double r133881 = r133877 + r133880;
        return r133881;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r133882 = b;
        double r133883 = a;
        double r133884 = t;
        double r133885 = z;
        double r133886 = x;
        double r133887 = y;
        double r133888 = r133886 * r133887;
        double r133889 = fma(r133884, r133885, r133888);
        double r133890 = fma(r133882, r133883, r133889);
        return r133890;
}

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 \mathsf{fma}\left(b, a, \color{blue}{t \cdot z + x \cdot y}\right)\]
  4. Simplified0.0

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

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

Reproduce

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