Average Error: 0.0 → 0.0
Time: 11.8s
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 r6706773 = x;
        double r6706774 = y;
        double r6706775 = r6706773 * r6706774;
        double r6706776 = z;
        double r6706777 = t;
        double r6706778 = r6706776 * r6706777;
        double r6706779 = r6706775 + r6706778;
        double r6706780 = a;
        double r6706781 = b;
        double r6706782 = r6706780 * r6706781;
        double r6706783 = r6706779 + r6706782;
        return r6706783;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r6706784 = a;
        double r6706785 = b;
        double r6706786 = x;
        double r6706787 = y;
        double r6706788 = z;
        double r6706789 = t;
        double r6706790 = r6706788 * r6706789;
        double r6706791 = fma(r6706786, r6706787, r6706790);
        double r6706792 = fma(r6706784, r6706785, r6706791);
        return r6706792;
}

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