Average Error: 0.0 → 0.0
Time: 7.2s
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 r94565 = x;
        double r94566 = y;
        double r94567 = r94565 * r94566;
        double r94568 = z;
        double r94569 = t;
        double r94570 = r94568 * r94569;
        double r94571 = r94567 - r94570;
        return r94571;
}

double f(double x, double y, double z, double t) {
        double r94572 = x;
        double r94573 = y;
        double r94574 = t;
        double r94575 = z;
        double r94576 = r94574 * r94575;
        double r94577 = -r94576;
        double r94578 = fma(r94572, r94573, r94577);
        return r94578;
}

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