Average Error: 0.0 → 0.0
Time: 5.0s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(c, i, \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(c, i, \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 r136880 = x;
        double r136881 = y;
        double r136882 = r136880 * r136881;
        double r136883 = z;
        double r136884 = t;
        double r136885 = r136883 * r136884;
        double r136886 = r136882 + r136885;
        double r136887 = a;
        double r136888 = b;
        double r136889 = r136887 * r136888;
        double r136890 = r136886 + r136889;
        double r136891 = c;
        double r136892 = i;
        double r136893 = r136891 * r136892;
        double r136894 = r136890 + r136893;
        return r136894;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r136895 = c;
        double r136896 = i;
        double r136897 = a;
        double r136898 = b;
        double r136899 = x;
        double r136900 = y;
        double r136901 = z;
        double r136902 = t;
        double r136903 = r136901 * r136902;
        double r136904 = fma(r136899, r136900, r136903);
        double r136905 = fma(r136897, r136898, r136904);
        double r136906 = fma(r136895, r136896, r136905);
        return r136906;
}

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

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

Reproduce

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