Average Error: 0.0 → 0.0
Time: 4.0s
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 r109186 = x;
        double r109187 = y;
        double r109188 = r109186 * r109187;
        double r109189 = z;
        double r109190 = t;
        double r109191 = r109189 * r109190;
        double r109192 = r109188 + r109191;
        double r109193 = a;
        double r109194 = b;
        double r109195 = r109193 * r109194;
        double r109196 = r109192 + r109195;
        double r109197 = c;
        double r109198 = i;
        double r109199 = r109197 * r109198;
        double r109200 = r109196 + r109199;
        return r109200;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r109201 = i;
        double r109202 = c;
        double r109203 = b;
        double r109204 = a;
        double r109205 = x;
        double r109206 = y;
        double r109207 = z;
        double r109208 = t;
        double r109209 = r109207 * r109208;
        double r109210 = fma(r109205, r109206, r109209);
        double r109211 = fma(r109203, r109204, r109210);
        double r109212 = fma(r109201, r109202, r109211);
        return r109212;
}

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