Average Error: 0.0 → 0.0
Time: 7.6s
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 r92394 = x;
        double r92395 = y;
        double r92396 = r92394 * r92395;
        double r92397 = z;
        double r92398 = t;
        double r92399 = r92397 * r92398;
        double r92400 = r92396 - r92399;
        return r92400;
}

double f(double x, double y, double z, double t) {
        double r92401 = x;
        double r92402 = y;
        double r92403 = t;
        double r92404 = z;
        double r92405 = r92403 * r92404;
        double r92406 = -r92405;
        double r92407 = fma(r92401, r92402, r92406);
        return r92407;
}

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