Average Error: 0.0 → 0.0
Time: 6.1s
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 r615 = x;
        double r616 = y;
        double r617 = r615 * r616;
        double r618 = z;
        double r619 = t;
        double r620 = r618 * r619;
        double r621 = r617 + r620;
        double r622 = a;
        double r623 = b;
        double r624 = r622 * r623;
        double r625 = r621 + r624;
        double r626 = c;
        double r627 = i;
        double r628 = r626 * r627;
        double r629 = r625 + r628;
        return r629;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r630 = i;
        double r631 = c;
        double r632 = b;
        double r633 = a;
        double r634 = x;
        double r635 = y;
        double r636 = z;
        double r637 = t;
        double r638 = r636 * r637;
        double r639 = fma(r634, r635, r638);
        double r640 = fma(r632, r633, r639);
        double r641 = fma(r630, r631, r640);
        return r641;
}

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