Average Error: 0.0 → 0.0
Time: 21.8s
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(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(i, c, \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 r5272974 = x;
        double r5272975 = y;
        double r5272976 = r5272974 * r5272975;
        double r5272977 = z;
        double r5272978 = t;
        double r5272979 = r5272977 * r5272978;
        double r5272980 = r5272976 + r5272979;
        double r5272981 = a;
        double r5272982 = b;
        double r5272983 = r5272981 * r5272982;
        double r5272984 = r5272980 + r5272983;
        double r5272985 = c;
        double r5272986 = i;
        double r5272987 = r5272985 * r5272986;
        double r5272988 = r5272984 + r5272987;
        return r5272988;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r5272989 = i;
        double r5272990 = c;
        double r5272991 = a;
        double r5272992 = b;
        double r5272993 = x;
        double r5272994 = y;
        double r5272995 = z;
        double r5272996 = t;
        double r5272997 = r5272995 * r5272996;
        double r5272998 = fma(r5272993, r5272994, r5272997);
        double r5272999 = fma(r5272991, r5272992, r5272998);
        double r5273000 = fma(r5272989, r5272990, r5272999);
        return r5273000;
}

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(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Final simplification0.0

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

Reproduce

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