Average Error: 0.0 → 0.0
Time: 6.7s
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 r112948 = x;
        double r112949 = y;
        double r112950 = r112948 * r112949;
        double r112951 = z;
        double r112952 = t;
        double r112953 = r112951 * r112952;
        double r112954 = r112950 + r112953;
        double r112955 = a;
        double r112956 = b;
        double r112957 = r112955 * r112956;
        double r112958 = r112954 + r112957;
        return r112958;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r112959 = a;
        double r112960 = b;
        double r112961 = x;
        double r112962 = y;
        double r112963 = z;
        double r112964 = t;
        double r112965 = r112963 * r112964;
        double r112966 = fma(r112961, r112962, r112965);
        double r112967 = fma(r112959, r112960, r112966);
        return r112967;
}

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