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(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 r110945 = x;
        double r110946 = y;
        double r110947 = r110945 * r110946;
        double r110948 = z;
        double r110949 = t;
        double r110950 = r110948 * r110949;
        double r110951 = r110947 + r110950;
        double r110952 = a;
        double r110953 = b;
        double r110954 = r110952 * r110953;
        double r110955 = r110951 + r110954;
        return r110955;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r110956 = t;
        double r110957 = z;
        double r110958 = a;
        double r110959 = b;
        double r110960 = x;
        double r110961 = y;
        double r110962 = r110960 * r110961;
        double r110963 = fma(r110958, r110959, r110962);
        double r110964 = fma(r110956, r110957, r110963);
        return r110964;
}

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