Average Error: 0.0 → 0.0
Time: 1.5s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \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(i, c, \mathsf{fma}\left(b, a, \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 r141256 = x;
        double r141257 = y;
        double r141258 = r141256 * r141257;
        double r141259 = z;
        double r141260 = t;
        double r141261 = r141259 * r141260;
        double r141262 = r141258 + r141261;
        double r141263 = a;
        double r141264 = b;
        double r141265 = r141263 * r141264;
        double r141266 = r141262 + r141265;
        double r141267 = c;
        double r141268 = i;
        double r141269 = r141267 * r141268;
        double r141270 = r141266 + r141269;
        return r141270;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r141271 = i;
        double r141272 = c;
        double r141273 = b;
        double r141274 = a;
        double r141275 = x;
        double r141276 = y;
        double r141277 = z;
        double r141278 = t;
        double r141279 = r141277 * r141278;
        double r141280 = fma(r141275, r141276, r141279);
        double r141281 = fma(r141273, r141274, r141280);
        double r141282 = fma(r141271, r141272, r141281);
        return r141282;
}

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

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

Reproduce

herbie shell --seed 2020065 +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)))