Average Error: 0.0 → 0.0
Time: 18.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 r96619 = x;
        double r96620 = y;
        double r96621 = r96619 * r96620;
        double r96622 = z;
        double r96623 = t;
        double r96624 = r96622 * r96623;
        double r96625 = r96621 + r96624;
        double r96626 = a;
        double r96627 = b;
        double r96628 = r96626 * r96627;
        double r96629 = r96625 + r96628;
        double r96630 = c;
        double r96631 = i;
        double r96632 = r96630 * r96631;
        double r96633 = r96629 + r96632;
        return r96633;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r96634 = c;
        double r96635 = i;
        double r96636 = a;
        double r96637 = b;
        double r96638 = x;
        double r96639 = y;
        double r96640 = z;
        double r96641 = t;
        double r96642 = r96640 * r96641;
        double r96643 = fma(r96638, r96639, r96642);
        double r96644 = fma(r96636, r96637, r96643);
        double r96645 = fma(r96634, r96635, r96644);
        return r96645;
}

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