Average Error: 0.0 → 0.0
Time: 6.5s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r93887 = x;
        double r93888 = y;
        double r93889 = r93887 * r93888;
        double r93890 = z;
        double r93891 = t;
        double r93892 = r93890 * r93891;
        double r93893 = r93889 + r93892;
        double r93894 = a;
        double r93895 = b;
        double r93896 = r93894 * r93895;
        double r93897 = r93893 + r93896;
        return r93897;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r93898 = a;
        double r93899 = b;
        double r93900 = x;
        double r93901 = y;
        double r93902 = z;
        double r93903 = t;
        double r93904 = r93902 * r93903;
        double r93905 = fma(r93900, r93901, r93904);
        double r93906 = fma(r93898, r93899, r93905);
        return r93906;
}

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

Derivation

  1. Initial program 0.0

    \[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
  2. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019305 +o rules:numerics
(FPCore (x y z t a b)
  :name "Linear.V3:$cdot from linear-1.19.1.3, B"
  :precision binary64
  (+ (+ (* x y) (* z t)) (* a b)))