Average Error: 0.0 → 0.0
Time: 1.6s
Precision: 64
\[\left(x \cdot y + z \cdot t\right) + a \cdot b\]
\[\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\]
\left(x \cdot y + z \cdot t\right) + a \cdot b
\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r99648 = x;
        double r99649 = y;
        double r99650 = r99648 * r99649;
        double r99651 = z;
        double r99652 = t;
        double r99653 = r99651 * r99652;
        double r99654 = r99650 + r99653;
        double r99655 = a;
        double r99656 = b;
        double r99657 = r99655 * r99656;
        double r99658 = r99654 + r99657;
        return r99658;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r99659 = t;
        double r99660 = z;
        double r99661 = a;
        double r99662 = b;
        double r99663 = x;
        double r99664 = y;
        double r99665 = r99663 * r99664;
        double r99666 = fma(r99661, r99662, r99665);
        double r99667 = fma(r99659, r99660, r99666);
        return r99667;
}

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(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)}\]
  3. Taylor expanded around inf 0.0

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

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

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

Reproduce

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