Average Error: 0.0 → 0.0
Time: 3.6s
Precision: 64
\[x \cdot y - z \cdot t\]
\[\mathsf{fma}\left(x, y, -t \cdot z\right)\]
x \cdot y - z \cdot t
\mathsf{fma}\left(x, y, -t \cdot z\right)
double f(double x, double y, double z, double t) {
        double r104606 = x;
        double r104607 = y;
        double r104608 = r104606 * r104607;
        double r104609 = z;
        double r104610 = t;
        double r104611 = r104609 * r104610;
        double r104612 = r104608 - r104611;
        return r104612;
}

double f(double x, double y, double z, double t) {
        double r104613 = x;
        double r104614 = y;
        double r104615 = t;
        double r104616 = z;
        double r104617 = r104615 * r104616;
        double r104618 = -r104617;
        double r104619 = fma(r104613, r104614, r104618);
        return r104619;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Derivation

  1. Initial program 0.0

    \[x \cdot y - z \cdot t\]
  2. Using strategy rm
  3. Applied fma-neg0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, -z \cdot t\right)}\]
  4. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019347 +o rules:numerics
(FPCore (x y z t)
  :name "Linear.V3:cross from linear-1.19.1.3"
  :precision binary64
  (- (* x y) (* z t)))