Average Error: 0.0 → 0.0
Time: 7.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 r86115 = x;
        double r86116 = y;
        double r86117 = r86115 * r86116;
        double r86118 = z;
        double r86119 = t;
        double r86120 = r86118 * r86119;
        double r86121 = r86117 - r86120;
        return r86121;
}

double f(double x, double y, double z, double t) {
        double r86122 = x;
        double r86123 = y;
        double r86124 = t;
        double r86125 = z;
        double r86126 = r86124 * r86125;
        double r86127 = -r86126;
        double r86128 = fma(r86122, r86123, r86127);
        return r86128;
}

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