Average Error: 0.0 → 0.0
Time: 6.3s
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 r110437 = x;
        double r110438 = y;
        double r110439 = r110437 * r110438;
        double r110440 = z;
        double r110441 = t;
        double r110442 = r110440 * r110441;
        double r110443 = r110439 - r110442;
        return r110443;
}

double f(double x, double y, double z, double t) {
        double r110444 = x;
        double r110445 = y;
        double r110446 = t;
        double r110447 = z;
        double r110448 = r110446 * r110447;
        double r110449 = -r110448;
        double r110450 = fma(r110444, r110445, r110449);
        return r110450;
}

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