Average Error: 0.0 → 0.0
Time: 6.5s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r113621 = x;
        double r113622 = y;
        double r113623 = r113621 * r113622;
        double r113624 = z;
        double r113625 = t;
        double r113626 = r113624 * r113625;
        double r113627 = r113623 + r113626;
        double r113628 = a;
        double r113629 = b;
        double r113630 = r113628 * r113629;
        double r113631 = r113627 + r113630;
        double r113632 = c;
        double r113633 = i;
        double r113634 = r113632 * r113633;
        double r113635 = r113631 + r113634;
        return r113635;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r113636 = c;
        double r113637 = i;
        double r113638 = a;
        double r113639 = b;
        double r113640 = x;
        double r113641 = y;
        double r113642 = z;
        double r113643 = t;
        double r113644 = r113642 * r113643;
        double r113645 = fma(r113640, r113641, r113644);
        double r113646 = fma(r113638, r113639, r113645);
        double r113647 = fma(r113636, r113637, r113646);
        return r113647;
}

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

Bits error versus c

Bits error versus i

Derivation

  1. Initial program 0.0

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

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

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

Reproduce

herbie shell --seed 2019326 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))