Average Error: 0.0 → 0.0
Time: 8.7s
Precision: 64
\[x \cdot y - z \cdot t\]
\[\mathsf{fma}\left(z, -t, x \cdot y\right)\]
x \cdot y - z \cdot t
\mathsf{fma}\left(z, -t, x \cdot y\right)
double f(double x, double y, double z, double t) {
        double r104380 = x;
        double r104381 = y;
        double r104382 = r104380 * r104381;
        double r104383 = z;
        double r104384 = t;
        double r104385 = r104383 * r104384;
        double r104386 = r104382 - r104385;
        return r104386;
}

double f(double x, double y, double z, double t) {
        double r104387 = z;
        double r104388 = t;
        double r104389 = -r104388;
        double r104390 = x;
        double r104391 = y;
        double r104392 = r104390 * r104391;
        double r104393 = fma(r104387, r104389, r104392);
        return r104393;
}

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. Using strategy rm
  6. Applied add-cbrt-cube36.3

    \[\leadsto \color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(x, y, -t \cdot z\right) \cdot \mathsf{fma}\left(x, y, -t \cdot z\right)\right) \cdot \mathsf{fma}\left(x, y, -t \cdot z\right)}}\]
  7. Simplified36.3

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\mathsf{fma}\left(x, y, -t \cdot z\right)\right)}^{3}}}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity36.3

    \[\leadsto \sqrt[3]{{\color{blue}{\left(1 \cdot \mathsf{fma}\left(x, y, -t \cdot z\right)\right)}}^{3}}\]
  10. Applied unpow-prod-down36.3

    \[\leadsto \sqrt[3]{\color{blue}{{1}^{3} \cdot {\left(\mathsf{fma}\left(x, y, -t \cdot z\right)\right)}^{3}}}\]
  11. Applied cbrt-prod36.3

    \[\leadsto \color{blue}{\sqrt[3]{{1}^{3}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(x, y, -t \cdot z\right)\right)}^{3}}}\]
  12. Simplified36.3

    \[\leadsto \color{blue}{1} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(x, y, -t \cdot z\right)\right)}^{3}}\]
  13. Simplified0.0

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

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

Reproduce

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