Average Error: 0.0 → 0.0
Time: 4.1s
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 r170171 = x;
        double r170172 = y;
        double r170173 = r170171 * r170172;
        double r170174 = z;
        double r170175 = t;
        double r170176 = r170174 * r170175;
        double r170177 = r170173 + r170176;
        double r170178 = a;
        double r170179 = b;
        double r170180 = r170178 * r170179;
        double r170181 = r170177 + r170180;
        double r170182 = c;
        double r170183 = i;
        double r170184 = r170182 * r170183;
        double r170185 = r170181 + r170184;
        return r170185;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r170186 = i;
        double r170187 = c;
        double r170188 = b;
        double r170189 = a;
        double r170190 = x;
        double r170191 = y;
        double r170192 = z;
        double r170193 = t;
        double r170194 = r170192 * r170193;
        double r170195 = fma(r170190, r170191, r170194);
        double r170196 = fma(r170188, r170189, r170195);
        double r170197 = fma(r170186, r170187, r170196);
        return r170197;
}

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