Average Error: 0.0 → 0.0
Time: 9.9s
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 r78620 = x;
        double r78621 = y;
        double r78622 = r78620 * r78621;
        double r78623 = z;
        double r78624 = t;
        double r78625 = r78623 * r78624;
        double r78626 = r78622 - r78625;
        return r78626;
}

double f(double x, double y, double z, double t) {
        double r78627 = x;
        double r78628 = y;
        double r78629 = t;
        double r78630 = z;
        double r78631 = r78629 * r78630;
        double r78632 = -r78631;
        double r78633 = fma(r78627, r78628, r78632);
        return r78633;
}

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)))