Average Error: 0.0 → 0.0
Time: 9.3s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r117191 = x;
        double r117192 = y;
        double r117193 = r117191 * r117192;
        double r117194 = z;
        double r117195 = t;
        double r117196 = r117194 * r117195;
        double r117197 = r117193 + r117196;
        double r117198 = a;
        double r117199 = b;
        double r117200 = r117198 * r117199;
        double r117201 = r117197 + r117200;
        return r117201;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r117202 = a;
        double r117203 = b;
        double r117204 = x;
        double r117205 = y;
        double r117206 = z;
        double r117207 = t;
        double r117208 = r117206 * r117207;
        double r117209 = fma(r117204, r117205, r117208);
        double r117210 = fma(r117202, r117203, r117209);
        return r117210;
}

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(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)}\]
  3. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\]

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(FPCore (x y z t a b)
  :name "Linear.V3:$cdot from linear-1.19.1.3, B"
  (+ (+ (* x y) (* z t)) (* a b)))