Average Error: 0.0 → 0.0
Time: 1.8s
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 r225542 = x;
        double r225543 = y;
        double r225544 = r225542 * r225543;
        double r225545 = z;
        double r225546 = t;
        double r225547 = r225545 * r225546;
        double r225548 = r225544 + r225547;
        double r225549 = a;
        double r225550 = b;
        double r225551 = r225549 * r225550;
        double r225552 = r225548 + r225551;
        return r225552;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r225553 = t;
        double r225554 = z;
        double r225555 = a;
        double r225556 = b;
        double r225557 = x;
        double r225558 = y;
        double r225559 = r225557 * r225558;
        double r225560 = fma(r225555, r225556, r225559);
        double r225561 = fma(r225553, r225554, r225560);
        return r225561;
}

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