Average Error: 0.0 → 0.0
Time: 7.8s
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 r130245 = x;
        double r130246 = y;
        double r130247 = r130245 * r130246;
        double r130248 = z;
        double r130249 = t;
        double r130250 = r130248 * r130249;
        double r130251 = r130247 + r130250;
        double r130252 = a;
        double r130253 = b;
        double r130254 = r130252 * r130253;
        double r130255 = r130251 + r130254;
        return r130255;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r130256 = a;
        double r130257 = b;
        double r130258 = x;
        double r130259 = y;
        double r130260 = z;
        double r130261 = t;
        double r130262 = r130260 * r130261;
        double r130263 = fma(r130258, r130259, r130262);
        double r130264 = fma(r130256, r130257, r130263);
        return r130264;
}

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