Average Error: 0.0 → 0.0
Time: 1.9s
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 r114481 = x;
        double r114482 = y;
        double r114483 = r114481 * r114482;
        double r114484 = z;
        double r114485 = t;
        double r114486 = r114484 * r114485;
        double r114487 = r114483 + r114486;
        double r114488 = a;
        double r114489 = b;
        double r114490 = r114488 * r114489;
        double r114491 = r114487 + r114490;
        return r114491;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r114492 = t;
        double r114493 = z;
        double r114494 = a;
        double r114495 = b;
        double r114496 = x;
        double r114497 = y;
        double r114498 = r114496 * r114497;
        double r114499 = fma(r114494, r114495, r114498);
        double r114500 = fma(r114492, r114493, r114499);
        return r114500;
}

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