Average Error: 0.0 → 0.0
Time: 9.4s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, b \cdot a\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, b \cdot a\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r92575 = x;
        double r92576 = y;
        double r92577 = r92575 * r92576;
        double r92578 = z;
        double r92579 = t;
        double r92580 = r92578 * r92579;
        double r92581 = r92577 + r92580;
        double r92582 = a;
        double r92583 = b;
        double r92584 = r92582 * r92583;
        double r92585 = r92581 + r92584;
        return r92585;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r92586 = z;
        double r92587 = t;
        double r92588 = x;
        double r92589 = y;
        double r92590 = b;
        double r92591 = a;
        double r92592 = r92590 * r92591;
        double r92593 = fma(r92588, r92589, r92592);
        double r92594 = fma(r92586, r92587, r92593);
        return r92594;
}

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. Taylor expanded around inf 0.0

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

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

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

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

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

Reproduce

herbie shell --seed 2019179 +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)))