Average Error: 0.0 → 0.0
Time: 5.4s
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 r96133 = x;
        double r96134 = y;
        double r96135 = r96133 * r96134;
        double r96136 = z;
        double r96137 = t;
        double r96138 = r96136 * r96137;
        double r96139 = r96135 - r96138;
        return r96139;
}

double f(double x, double y, double z, double t) {
        double r96140 = x;
        double r96141 = y;
        double r96142 = t;
        double r96143 = z;
        double r96144 = r96142 * r96143;
        double r96145 = -r96144;
        double r96146 = fma(r96140, r96141, r96145);
        return r96146;
}

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