Average Error: 0.0 → 0.0
Time: 1.9s
Precision: 64
\[x \cdot y - z \cdot t\]
\[\mathsf{fma}\left(-t, z, x \cdot y\right)\]
x \cdot y - z \cdot t
\mathsf{fma}\left(-t, z, x \cdot y\right)
double f(double x, double y, double z, double t) {
        double r93948 = x;
        double r93949 = y;
        double r93950 = r93948 * r93949;
        double r93951 = z;
        double r93952 = t;
        double r93953 = r93951 * r93952;
        double r93954 = r93950 - r93953;
        return r93954;
}

double f(double x, double y, double z, double t) {
        double r93955 = t;
        double r93956 = -r93955;
        double r93957 = z;
        double r93958 = x;
        double r93959 = y;
        double r93960 = r93958 * r93959;
        double r93961 = fma(r93956, r93957, r93960);
        return r93961;
}

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. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(-t, z, x \cdot y\right)}\]
  3. Final simplification0.0

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

Reproduce

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