Average Error: 0.0 → 0.0
Time: 869.0ms
Precision: 64
\[x \cdot y - z \cdot t\]
\[\mathsf{fma}\left(x, y, -z \cdot t\right)\]
x \cdot y - z \cdot t
\mathsf{fma}\left(x, y, -z \cdot t\right)
double f(double x, double y, double z, double t) {
        double r98709 = x;
        double r98710 = y;
        double r98711 = r98709 * r98710;
        double r98712 = z;
        double r98713 = t;
        double r98714 = r98712 * r98713;
        double r98715 = r98711 - r98714;
        return r98715;
}

double f(double x, double y, double z, double t) {
        double r98716 = x;
        double r98717 = y;
        double r98718 = z;
        double r98719 = t;
        double r98720 = r98718 * r98719;
        double r98721 = -r98720;
        double r98722 = fma(r98716, r98717, r98721);
        return r98722;
}

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. Final simplification0.0

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

Reproduce

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