Average Error: 0.0 → 0.0
Time: 2.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 r153807 = x;
        double r153808 = y;
        double r153809 = r153807 * r153808;
        double r153810 = z;
        double r153811 = t;
        double r153812 = r153810 * r153811;
        double r153813 = r153809 + r153812;
        double r153814 = a;
        double r153815 = b;
        double r153816 = r153814 * r153815;
        double r153817 = r153813 + r153816;
        return r153817;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r153818 = t;
        double r153819 = z;
        double r153820 = a;
        double r153821 = b;
        double r153822 = x;
        double r153823 = y;
        double r153824 = r153822 * r153823;
        double r153825 = fma(r153820, r153821, r153824);
        double r153826 = fma(r153818, r153819, r153825);
        return r153826;
}

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