Average Error: 0.0 → 0.0
Time: 3.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 r67523 = x;
        double r67524 = y;
        double r67525 = r67523 * r67524;
        double r67526 = z;
        double r67527 = t;
        double r67528 = r67526 * r67527;
        double r67529 = r67525 + r67528;
        double r67530 = a;
        double r67531 = b;
        double r67532 = r67530 * r67531;
        double r67533 = r67529 + r67532;
        double r67534 = c;
        double r67535 = i;
        double r67536 = r67534 * r67535;
        double r67537 = r67533 + r67536;
        return r67537;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r67538 = i;
        double r67539 = c;
        double r67540 = b;
        double r67541 = a;
        double r67542 = x;
        double r67543 = y;
        double r67544 = z;
        double r67545 = t;
        double r67546 = r67544 * r67545;
        double r67547 = fma(r67542, r67543, r67546);
        double r67548 = fma(r67540, r67541, r67547);
        double r67549 = fma(r67538, r67539, r67548);
        return r67549;
}

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 2020025 +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)))