Average Error: 0.0 → 0.0
Time: 12.3s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(a, b, \mathsf{fma}\left(z, t, x \cdot y\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(a, b, \mathsf{fma}\left(z, t, x \cdot y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r6864254 = x;
        double r6864255 = y;
        double r6864256 = r6864254 * r6864255;
        double r6864257 = z;
        double r6864258 = t;
        double r6864259 = r6864257 * r6864258;
        double r6864260 = r6864256 + r6864259;
        double r6864261 = a;
        double r6864262 = b;
        double r6864263 = r6864261 * r6864262;
        double r6864264 = r6864260 + r6864263;
        return r6864264;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r6864265 = a;
        double r6864266 = b;
        double r6864267 = z;
        double r6864268 = t;
        double r6864269 = x;
        double r6864270 = y;
        double r6864271 = r6864269 * r6864270;
        double r6864272 = fma(r6864267, r6864268, r6864271);
        double r6864273 = fma(r6864265, r6864266, r6864272);
        return r6864273;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Derivation

  1. Initial program 0.0

    \[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
  2. Simplified0.0

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

    \[\leadsto \mathsf{fma}\left(a, b, \color{blue}{t \cdot z + x \cdot y}\right)\]
  4. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019169 +o rules:numerics
(FPCore (x y z t a b)
  :name "Linear.V3:$cdot from linear-1.19.1.3, B"
  (+ (+ (* x y) (* z t)) (* a b)))