Average Error: 0.0 → 0.0
Time: 2.4s
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 r64825 = x;
        double r64826 = y;
        double r64827 = r64825 * r64826;
        double r64828 = z;
        double r64829 = t;
        double r64830 = r64828 * r64829;
        double r64831 = r64827 + r64830;
        double r64832 = a;
        double r64833 = b;
        double r64834 = r64832 * r64833;
        double r64835 = r64831 + r64834;
        double r64836 = c;
        double r64837 = i;
        double r64838 = r64836 * r64837;
        double r64839 = r64835 + r64838;
        return r64839;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r64840 = i;
        double r64841 = c;
        double r64842 = b;
        double r64843 = a;
        double r64844 = x;
        double r64845 = y;
        double r64846 = z;
        double r64847 = t;
        double r64848 = r64846 * r64847;
        double r64849 = fma(r64844, r64845, r64848);
        double r64850 = fma(r64842, r64843, r64849);
        double r64851 = fma(r64840, r64841, r64850);
        return r64851;
}

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 2020035 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))