Average Error: 0.0 → 0.0
Time: 7.0s
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 r92749 = x;
        double r92750 = y;
        double r92751 = r92749 * r92750;
        double r92752 = z;
        double r92753 = t;
        double r92754 = r92752 * r92753;
        double r92755 = r92751 + r92754;
        double r92756 = a;
        double r92757 = b;
        double r92758 = r92756 * r92757;
        double r92759 = r92755 + r92758;
        return r92759;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r92760 = t;
        double r92761 = z;
        double r92762 = a;
        double r92763 = b;
        double r92764 = x;
        double r92765 = y;
        double r92766 = r92764 * r92765;
        double r92767 = fma(r92762, r92763, r92766);
        double r92768 = fma(r92760, r92761, r92767);
        return r92768;
}

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(a, b, \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 2019306 +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)))