Average Error: 0.0 → 0.0
Time: 2.3s
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 r139963 = x;
        double r139964 = y;
        double r139965 = r139963 * r139964;
        double r139966 = z;
        double r139967 = t;
        double r139968 = r139966 * r139967;
        double r139969 = r139965 + r139968;
        double r139970 = a;
        double r139971 = b;
        double r139972 = r139970 * r139971;
        double r139973 = r139969 + r139972;
        double r139974 = c;
        double r139975 = i;
        double r139976 = r139974 * r139975;
        double r139977 = r139973 + r139976;
        return r139977;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r139978 = i;
        double r139979 = c;
        double r139980 = t;
        double r139981 = z;
        double r139982 = a;
        double r139983 = b;
        double r139984 = x;
        double r139985 = y;
        double r139986 = r139984 * r139985;
        double r139987 = fma(r139982, r139983, r139986);
        double r139988 = fma(r139980, r139981, r139987);
        double r139989 = fma(r139978, r139979, r139988);
        return r139989;
}

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