Average Error: 0.0 → 0.0
Time: 887.0ms
Precision: 64
\[x \cdot y - z \cdot t\]
\[\mathsf{fma}\left(x, y, -z \cdot t\right)\]
x \cdot y - z \cdot t
\mathsf{fma}\left(x, y, -z \cdot t\right)
double f(double x, double y, double z, double t) {
        double r116728 = x;
        double r116729 = y;
        double r116730 = r116728 * r116729;
        double r116731 = z;
        double r116732 = t;
        double r116733 = r116731 * r116732;
        double r116734 = r116730 - r116733;
        return r116734;
}

double f(double x, double y, double z, double t) {
        double r116735 = x;
        double r116736 = y;
        double r116737 = z;
        double r116738 = t;
        double r116739 = r116737 * r116738;
        double r116740 = -r116739;
        double r116741 = fma(r116735, r116736, r116740);
        return r116741;
}

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. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(x, y, -z \cdot t\right)\]

Reproduce

herbie shell --seed 2019362 +o rules:numerics
(FPCore (x y z t)
  :name "Linear.V3:cross from linear-1.19.1.3"
  :precision binary64
  (- (* x y) (* z t)))