Average Error: 0.0 → 0.0
Time: 11.3s
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(t, z, \mathsf{fma}\left(a, b, 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(t, z, \mathsf{fma}\left(a, b, 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 r104461 = x;
        double r104462 = y;
        double r104463 = r104461 * r104462;
        double r104464 = z;
        double r104465 = t;
        double r104466 = r104464 * r104465;
        double r104467 = r104463 + r104466;
        double r104468 = a;
        double r104469 = b;
        double r104470 = r104468 * r104469;
        double r104471 = r104467 + r104470;
        double r104472 = c;
        double r104473 = i;
        double r104474 = r104472 * r104473;
        double r104475 = r104471 + r104474;
        return r104475;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r104476 = i;
        double r104477 = c;
        double r104478 = t;
        double r104479 = z;
        double r104480 = a;
        double r104481 = b;
        double r104482 = x;
        double r104483 = y;
        double r104484 = r104482 * r104483;
        double r104485 = fma(r104480, r104481, r104484);
        double r104486 = fma(r104478, r104479, r104485);
        double r104487 = fma(r104476, r104477, r104486);
        return r104487;
}

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, \color{blue}{t \cdot z + \left(a \cdot b + x \cdot y\right)}\right)\]
  4. Simplified0.0

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

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

Reproduce

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