Average Error: 0.0 → 0.0
Time: 8.8s
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 r5074520 = x;
        double r5074521 = y;
        double r5074522 = r5074520 * r5074521;
        double r5074523 = z;
        double r5074524 = t;
        double r5074525 = r5074523 * r5074524;
        double r5074526 = r5074522 + r5074525;
        double r5074527 = a;
        double r5074528 = b;
        double r5074529 = r5074527 * r5074528;
        double r5074530 = r5074526 + r5074529;
        return r5074530;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r5074531 = a;
        double r5074532 = b;
        double r5074533 = z;
        double r5074534 = t;
        double r5074535 = x;
        double r5074536 = y;
        double r5074537 = r5074535 * r5074536;
        double r5074538 = fma(r5074533, r5074534, r5074537);
        double r5074539 = fma(r5074531, r5074532, r5074538);
        return r5074539;
}

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 2019192 +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)))