Average Error: 0.0 → 0.0
Time: 2.1s
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 r116481 = x;
        double r116482 = y;
        double r116483 = r116481 * r116482;
        double r116484 = z;
        double r116485 = t;
        double r116486 = r116484 * r116485;
        double r116487 = r116483 + r116486;
        double r116488 = a;
        double r116489 = b;
        double r116490 = r116488 * r116489;
        double r116491 = r116487 + r116490;
        return r116491;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r116492 = t;
        double r116493 = z;
        double r116494 = a;
        double r116495 = b;
        double r116496 = x;
        double r116497 = y;
        double r116498 = r116496 * r116497;
        double r116499 = fma(r116494, r116495, r116498);
        double r116500 = fma(r116492, r116493, r116499);
        return r116500;
}

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