Average Error: 0.0 → 0.0
Time: 7.7s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(t, z, x \cdot y\right) + a \cdot b\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(t, z, x \cdot y\right) + a \cdot b
double f(double x, double y, double z, double t, double a, double b) {
        double r69637 = x;
        double r69638 = y;
        double r69639 = r69637 * r69638;
        double r69640 = z;
        double r69641 = t;
        double r69642 = r69640 * r69641;
        double r69643 = r69639 + r69642;
        double r69644 = a;
        double r69645 = b;
        double r69646 = r69644 * r69645;
        double r69647 = r69643 + r69646;
        return r69647;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r69648 = t;
        double r69649 = z;
        double r69650 = x;
        double r69651 = y;
        double r69652 = r69650 * r69651;
        double r69653 = fma(r69648, r69649, r69652);
        double r69654 = a;
        double r69655 = b;
        double r69656 = r69654 * r69655;
        double r69657 = r69653 + r69656;
        return r69657;
}

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. Taylor expanded around inf 0.0

    \[\leadsto \color{blue}{\left(t \cdot z + x \cdot y\right)} + a \cdot b\]
  3. Simplified0.0

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

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

Reproduce

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