Average Error: 0.0 → 0.0
Time: 1.8s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r100747 = x;
        double r100748 = y;
        double r100749 = r100747 * r100748;
        double r100750 = z;
        double r100751 = t;
        double r100752 = r100750 * r100751;
        double r100753 = r100749 + r100752;
        double r100754 = a;
        double r100755 = b;
        double r100756 = r100754 * r100755;
        double r100757 = r100753 + r100756;
        return r100757;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r100758 = t;
        double r100759 = z;
        double r100760 = a;
        double r100761 = b;
        double r100762 = x;
        double r100763 = y;
        double r100764 = r100762 * r100763;
        double r100765 = fma(r100760, r100761, r100764);
        double r100766 = fma(r100758, r100759, r100765);
        return r100766;
}

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(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)}\]
  3. Taylor expanded around inf 0.0

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

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

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

Reproduce

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