Average Error: 0.0 → 0.0
Time: 1.7s
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 r107801 = x;
        double r107802 = y;
        double r107803 = r107801 * r107802;
        double r107804 = z;
        double r107805 = t;
        double r107806 = r107804 * r107805;
        double r107807 = r107803 + r107806;
        double r107808 = a;
        double r107809 = b;
        double r107810 = r107808 * r107809;
        double r107811 = r107807 + r107810;
        return r107811;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r107812 = t;
        double r107813 = z;
        double r107814 = a;
        double r107815 = b;
        double r107816 = x;
        double r107817 = y;
        double r107818 = r107816 * r107817;
        double r107819 = fma(r107814, r107815, r107818);
        double r107820 = fma(r107812, r107813, r107819);
        return r107820;
}

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