Average Error: 0.0 → 0.0
Time: 7.6s
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 r104227 = x;
        double r104228 = y;
        double r104229 = r104227 * r104228;
        double r104230 = z;
        double r104231 = t;
        double r104232 = r104230 * r104231;
        double r104233 = r104229 + r104232;
        double r104234 = a;
        double r104235 = b;
        double r104236 = r104234 * r104235;
        double r104237 = r104233 + r104236;
        return r104237;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r104238 = a;
        double r104239 = b;
        double r104240 = x;
        double r104241 = y;
        double r104242 = z;
        double r104243 = t;
        double r104244 = r104242 * r104243;
        double r104245 = fma(r104240, r104241, r104244);
        double r104246 = fma(r104238, r104239, r104245);
        return r104246;
}

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