Average Error: 0.0 → 0.0
Time: 3.1s
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(a, b, \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(c, i, \mathsf{fma}\left(a, b, \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 r110604 = x;
        double r110605 = y;
        double r110606 = r110604 * r110605;
        double r110607 = z;
        double r110608 = t;
        double r110609 = r110607 * r110608;
        double r110610 = r110606 + r110609;
        double r110611 = a;
        double r110612 = b;
        double r110613 = r110611 * r110612;
        double r110614 = r110610 + r110613;
        double r110615 = c;
        double r110616 = i;
        double r110617 = r110615 * r110616;
        double r110618 = r110614 + r110617;
        return r110618;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r110619 = c;
        double r110620 = i;
        double r110621 = a;
        double r110622 = b;
        double r110623 = x;
        double r110624 = y;
        double r110625 = z;
        double r110626 = t;
        double r110627 = r110625 * r110626;
        double r110628 = fma(r110623, r110624, r110627);
        double r110629 = fma(r110621, r110622, r110628);
        double r110630 = fma(r110619, r110620, r110629);
        return r110630;
}

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. Final simplification0.0

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