Average Error: 0.0 → 0.0
Time: 5.6s
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 r90970 = x;
        double r90971 = y;
        double r90972 = r90970 * r90971;
        double r90973 = z;
        double r90974 = t;
        double r90975 = r90973 * r90974;
        double r90976 = r90972 + r90975;
        double r90977 = a;
        double r90978 = b;
        double r90979 = r90977 * r90978;
        double r90980 = r90976 + r90979;
        return r90980;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r90981 = a;
        double r90982 = b;
        double r90983 = x;
        double r90984 = y;
        double r90985 = z;
        double r90986 = t;
        double r90987 = r90985 * r90986;
        double r90988 = fma(r90983, r90984, r90987);
        double r90989 = fma(r90981, r90982, r90988);
        return r90989;
}

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 2019174 +o rules:numerics
(FPCore (x y z t a b)
  :name "Linear.V3:$cdot from linear-1.19.1.3, B"
  (+ (+ (* x y) (* z t)) (* a b)))