Average Error: 0.0 → 0.0
Time: 2.9s
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(t, z, x \cdot y\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(t, z, x \cdot y\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r131441 = x;
        double r131442 = y;
        double r131443 = r131441 * r131442;
        double r131444 = z;
        double r131445 = t;
        double r131446 = r131444 * r131445;
        double r131447 = r131443 + r131446;
        double r131448 = a;
        double r131449 = b;
        double r131450 = r131448 * r131449;
        double r131451 = r131447 + r131450;
        double r131452 = c;
        double r131453 = i;
        double r131454 = r131452 * r131453;
        double r131455 = r131451 + r131454;
        return r131455;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r131456 = i;
        double r131457 = c;
        double r131458 = b;
        double r131459 = a;
        double r131460 = t;
        double r131461 = z;
        double r131462 = x;
        double r131463 = y;
        double r131464 = r131462 * r131463;
        double r131465 = fma(r131460, r131461, r131464);
        double r131466 = fma(r131458, r131459, r131465);
        double r131467 = fma(r131456, r131457, r131466);
        return r131467;
}

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. Taylor expanded around inf 0.0

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

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

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

Reproduce

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