Average Error: 0.0 → 0.0
Time: 8.0s
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 r121047 = x;
        double r121048 = y;
        double r121049 = r121047 * r121048;
        double r121050 = z;
        double r121051 = t;
        double r121052 = r121050 * r121051;
        double r121053 = r121049 - r121052;
        return r121053;
}

double f(double x, double y, double z, double t) {
        double r121054 = x;
        double r121055 = y;
        double r121056 = t;
        double r121057 = z;
        double r121058 = r121056 * r121057;
        double r121059 = -r121058;
        double r121060 = fma(r121054, r121055, r121059);
        return r121060;
}

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