Average Error: 0.0 → 0.0
Time: 10.1s
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 r75327 = x;
        double r75328 = y;
        double r75329 = r75327 * r75328;
        double r75330 = z;
        double r75331 = t;
        double r75332 = r75330 * r75331;
        double r75333 = r75329 - r75332;
        return r75333;
}

double f(double x, double y, double z, double t) {
        double r75334 = x;
        double r75335 = y;
        double r75336 = t;
        double r75337 = z;
        double r75338 = r75336 * r75337;
        double r75339 = -r75338;
        double r75340 = fma(r75334, r75335, r75339);
        return r75340;
}

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