Average Error: 0.0 → 0.0
Time: 4.8s
Precision: 64
\[x \cdot y - z \cdot t\]
\[\mathsf{fma}\left(-t, z, x \cdot y\right)\]
x \cdot y - z \cdot t
\mathsf{fma}\left(-t, z, x \cdot y\right)
double f(double x, double y, double z, double t) {
        double r70689 = x;
        double r70690 = y;
        double r70691 = r70689 * r70690;
        double r70692 = z;
        double r70693 = t;
        double r70694 = r70692 * r70693;
        double r70695 = r70691 - r70694;
        return r70695;
}

double f(double x, double y, double z, double t) {
        double r70696 = t;
        double r70697 = -r70696;
        double r70698 = z;
        double r70699 = x;
        double r70700 = y;
        double r70701 = r70699 * r70700;
        double r70702 = fma(r70697, r70698, r70701);
        return r70702;
}

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. Simplified0.0

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

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

Reproduce

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