Average Error: 0.0 → 0.0
Time: 10.3s
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 r94164 = x;
        double r94165 = y;
        double r94166 = r94164 * r94165;
        double r94167 = z;
        double r94168 = t;
        double r94169 = r94167 * r94168;
        double r94170 = r94166 + r94169;
        double r94171 = a;
        double r94172 = b;
        double r94173 = r94171 * r94172;
        double r94174 = r94170 + r94173;
        double r94175 = c;
        double r94176 = i;
        double r94177 = r94175 * r94176;
        double r94178 = r94174 + r94177;
        return r94178;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r94179 = c;
        double r94180 = i;
        double r94181 = a;
        double r94182 = b;
        double r94183 = x;
        double r94184 = y;
        double r94185 = z;
        double r94186 = t;
        double r94187 = r94185 * r94186;
        double r94188 = fma(r94183, r94184, r94187);
        double r94189 = fma(r94181, r94182, r94188);
        double r94190 = fma(r94179, r94180, r94189);
        return r94190;
}

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