Average Error: 0.0 → 0.0
Time: 8.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 r97450 = x;
        double r97451 = y;
        double r97452 = r97450 * r97451;
        double r97453 = z;
        double r97454 = t;
        double r97455 = r97453 * r97454;
        double r97456 = r97452 - r97455;
        return r97456;
}

double f(double x, double y, double z, double t) {
        double r97457 = x;
        double r97458 = y;
        double r97459 = t;
        double r97460 = z;
        double r97461 = r97459 * r97460;
        double r97462 = -r97461;
        double r97463 = fma(r97457, r97458, r97462);
        return r97463;
}

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