Average Error: 0.0 → 0.0
Time: 3.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(b, a, \mathsf{fma}\left(t, z, 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(b, a, \mathsf{fma}\left(t, z, 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 r92865 = x;
        double r92866 = y;
        double r92867 = r92865 * r92866;
        double r92868 = z;
        double r92869 = t;
        double r92870 = r92868 * r92869;
        double r92871 = r92867 + r92870;
        double r92872 = a;
        double r92873 = b;
        double r92874 = r92872 * r92873;
        double r92875 = r92871 + r92874;
        double r92876 = c;
        double r92877 = i;
        double r92878 = r92876 * r92877;
        double r92879 = r92875 + r92878;
        return r92879;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r92880 = i;
        double r92881 = c;
        double r92882 = b;
        double r92883 = a;
        double r92884 = t;
        double r92885 = z;
        double r92886 = x;
        double r92887 = y;
        double r92888 = r92886 * r92887;
        double r92889 = fma(r92884, r92885, r92888);
        double r92890 = fma(r92882, r92883, r92889);
        double r92891 = fma(r92880, r92881, r92890);
        return r92891;
}

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, \mathsf{fma}\left(b, a, \color{blue}{t \cdot z + x \cdot y}\right)\right)\]
  4. Simplified0.0

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

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

Reproduce

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