Average Error: 0.0 → 0.0
Time: 2.4s
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(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(i, c, \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 r141172 = x;
        double r141173 = y;
        double r141174 = r141172 * r141173;
        double r141175 = z;
        double r141176 = t;
        double r141177 = r141175 * r141176;
        double r141178 = r141174 + r141177;
        double r141179 = a;
        double r141180 = b;
        double r141181 = r141179 * r141180;
        double r141182 = r141178 + r141181;
        double r141183 = c;
        double r141184 = i;
        double r141185 = r141183 * r141184;
        double r141186 = r141182 + r141185;
        return r141186;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r141187 = i;
        double r141188 = c;
        double r141189 = t;
        double r141190 = z;
        double r141191 = a;
        double r141192 = b;
        double r141193 = x;
        double r141194 = y;
        double r141195 = r141193 * r141194;
        double r141196 = fma(r141191, r141192, r141195);
        double r141197 = fma(r141189, r141190, r141196);
        double r141198 = fma(r141187, r141188, r141197);
        return r141198;
}

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

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

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

Reproduce

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