Average Error: 0.0 → 0.0
Time: 3.8s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \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(i, c, \mathsf{fma}\left(b, a, \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 r122761 = x;
        double r122762 = y;
        double r122763 = r122761 * r122762;
        double r122764 = z;
        double r122765 = t;
        double r122766 = r122764 * r122765;
        double r122767 = r122763 + r122766;
        double r122768 = a;
        double r122769 = b;
        double r122770 = r122768 * r122769;
        double r122771 = r122767 + r122770;
        double r122772 = c;
        double r122773 = i;
        double r122774 = r122772 * r122773;
        double r122775 = r122771 + r122774;
        return r122775;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r122776 = i;
        double r122777 = c;
        double r122778 = b;
        double r122779 = a;
        double r122780 = x;
        double r122781 = y;
        double r122782 = z;
        double r122783 = t;
        double r122784 = r122782 * r122783;
        double r122785 = fma(r122780, r122781, r122784);
        double r122786 = fma(r122778, r122779, r122785);
        double r122787 = fma(r122776, r122777, r122786);
        return r122787;
}

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(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Final simplification0.0

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

Reproduce

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