Average Error: 0.0 → 0.0
Time: 1.7s
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 r65265 = x;
        double r65266 = y;
        double r65267 = r65265 * r65266;
        double r65268 = z;
        double r65269 = t;
        double r65270 = r65268 * r65269;
        double r65271 = r65267 + r65270;
        double r65272 = a;
        double r65273 = b;
        double r65274 = r65272 * r65273;
        double r65275 = r65271 + r65274;
        double r65276 = c;
        double r65277 = i;
        double r65278 = r65276 * r65277;
        double r65279 = r65275 + r65278;
        return r65279;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r65280 = i;
        double r65281 = c;
        double r65282 = b;
        double r65283 = a;
        double r65284 = x;
        double r65285 = y;
        double r65286 = z;
        double r65287 = t;
        double r65288 = r65286 * r65287;
        double r65289 = fma(r65284, r65285, r65288);
        double r65290 = fma(r65282, r65283, r65289);
        double r65291 = fma(r65280, r65281, r65290);
        return r65291;
}

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"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))