Average Error: 0.0 → 0.0
Time: 18.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(z, t, \mathsf{fma}\left(x, y, a \cdot b\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(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r2600976 = x;
        double r2600977 = y;
        double r2600978 = r2600976 * r2600977;
        double r2600979 = z;
        double r2600980 = t;
        double r2600981 = r2600979 * r2600980;
        double r2600982 = r2600978 + r2600981;
        double r2600983 = a;
        double r2600984 = b;
        double r2600985 = r2600983 * r2600984;
        double r2600986 = r2600982 + r2600985;
        double r2600987 = c;
        double r2600988 = i;
        double r2600989 = r2600987 * r2600988;
        double r2600990 = r2600986 + r2600989;
        return r2600990;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r2600991 = i;
        double r2600992 = c;
        double r2600993 = z;
        double r2600994 = t;
        double r2600995 = x;
        double r2600996 = y;
        double r2600997 = a;
        double r2600998 = b;
        double r2600999 = r2600997 * r2600998;
        double r2601000 = fma(r2600995, r2600996, r2600999);
        double r2601001 = fma(r2600993, r2600994, r2601000);
        double r2601002 = fma(r2600991, r2600992, r2601001);
        return r2601002;
}

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(y, x, \mathsf{fma}\left(b, a, z \cdot t\right)\right)\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.0

    \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(y, x, \color{blue}{b \cdot a + z \cdot t}\right)\right)\]
  5. Taylor expanded around inf 0.0

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

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

    \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3"
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))