Average Error: 0.0 → 0.0
Time: 1.4s
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 r111904 = x;
        double r111905 = y;
        double r111906 = r111904 * r111905;
        double r111907 = z;
        double r111908 = t;
        double r111909 = r111907 * r111908;
        double r111910 = r111906 + r111909;
        double r111911 = a;
        double r111912 = b;
        double r111913 = r111911 * r111912;
        double r111914 = r111910 + r111913;
        return r111914;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r111915 = b;
        double r111916 = a;
        double r111917 = t;
        double r111918 = z;
        double r111919 = x;
        double r111920 = y;
        double r111921 = r111919 * r111920;
        double r111922 = fma(r111917, r111918, r111921);
        double r111923 = fma(r111915, r111916, r111922);
        return r111923;
}

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