Average Error: 0.0 → 0.0
Time: 17.0s
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(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(c, i, \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 r87522 = x;
        double r87523 = y;
        double r87524 = r87522 * r87523;
        double r87525 = z;
        double r87526 = t;
        double r87527 = r87525 * r87526;
        double r87528 = r87524 + r87527;
        double r87529 = a;
        double r87530 = b;
        double r87531 = r87529 * r87530;
        double r87532 = r87528 + r87531;
        double r87533 = c;
        double r87534 = i;
        double r87535 = r87533 * r87534;
        double r87536 = r87532 + r87535;
        return r87536;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r87537 = c;
        double r87538 = i;
        double r87539 = t;
        double r87540 = z;
        double r87541 = a;
        double r87542 = b;
        double r87543 = x;
        double r87544 = y;
        double r87545 = r87543 * r87544;
        double r87546 = fma(r87541, r87542, r87545);
        double r87547 = fma(r87539, r87540, r87546);
        double r87548 = fma(r87537, r87538, r87547);
        return r87548;
}

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

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

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

Reproduce

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