Average Error: 0.0 → 0.0
Time: 8.2s
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 r132992 = x;
        double r132993 = y;
        double r132994 = r132992 * r132993;
        double r132995 = z;
        double r132996 = t;
        double r132997 = r132995 * r132996;
        double r132998 = r132994 + r132997;
        return r132998;
}

double f(double x, double y, double z, double t) {
        double r132999 = t;
        double r133000 = z;
        double r133001 = x;
        double r133002 = y;
        double r133003 = r133001 * r133002;
        double r133004 = fma(r132999, r133000, r133003);
        return r133004;
}

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(x, y, z \cdot t\right)}\]
  3. Using strategy rm
  4. Applied add-cbrt-cube37.0

    \[\leadsto \color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(x, y, z \cdot t\right) \cdot \mathsf{fma}\left(x, y, z \cdot t\right)\right) \cdot \mathsf{fma}\left(x, y, z \cdot t\right)}}\]
  5. Simplified37.0

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\mathsf{fma}\left(x, y, z \cdot t\right)\right)}^{3}}}\]
  6. Taylor expanded around inf 0.0

    \[\leadsto \color{blue}{t \cdot z + x \cdot y}\]
  7. Simplified0.0

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

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

Reproduce

herbie shell --seed 2020042 +o rules:numerics
(FPCore (x y z t)
  :name "Linear.V2:$cdot from linear-1.19.1.3, A"
  :precision binary64
  (+ (* x y) (* z t)))