Average Error: 0.0 → 0.0
Time: 1.6s
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 r158735 = x;
        double r158736 = y;
        double r158737 = r158735 * r158736;
        double r158738 = z;
        double r158739 = t;
        double r158740 = r158738 * r158739;
        double r158741 = r158737 - r158740;
        return r158741;
}

double f(double x, double y, double z, double t) {
        double r158742 = t;
        double r158743 = -r158742;
        double r158744 = z;
        double r158745 = x;
        double r158746 = y;
        double r158747 = r158745 * r158746;
        double r158748 = fma(r158743, r158744, r158747);
        return r158748;
}

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 2019179 +o rules:numerics
(FPCore (x y z t)
  :name "Linear.V3:cross from linear-1.19.1.3"
  (- (* x y) (* z t)))