Average Error: 0.0 → 0.0
Time: 11.7s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r157229 = x;
        double r157230 = y;
        double r157231 = r157229 * r157230;
        double r157232 = z;
        double r157233 = t;
        double r157234 = r157232 * r157233;
        double r157235 = r157231 + r157234;
        double r157236 = a;
        double r157237 = b;
        double r157238 = r157236 * r157237;
        double r157239 = r157235 + r157238;
        double r157240 = c;
        double r157241 = i;
        double r157242 = r157240 * r157241;
        double r157243 = r157239 + r157242;
        return r157243;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r157244 = c;
        double r157245 = i;
        double r157246 = a;
        double r157247 = b;
        double r157248 = x;
        double r157249 = y;
        double r157250 = z;
        double r157251 = t;
        double r157252 = r157250 * r157251;
        double r157253 = fma(r157248, r157249, r157252);
        double r157254 = fma(r157246, r157247, r157253);
        double r157255 = fma(r157244, r157245, r157254);
        return r157255;
}

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

Bits error versus c

Bits error versus i

Derivation

  1. Initial program 0.0

    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2020045 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))