Average Error: 0.0 → 0.0
Time: 2.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 r124200 = x;
        double r124201 = y;
        double r124202 = r124200 * r124201;
        double r124203 = z;
        double r124204 = t;
        double r124205 = r124203 * r124204;
        double r124206 = r124202 + r124205;
        double r124207 = a;
        double r124208 = b;
        double r124209 = r124207 * r124208;
        double r124210 = r124206 + r124209;
        double r124211 = c;
        double r124212 = i;
        double r124213 = r124211 * r124212;
        double r124214 = r124210 + r124213;
        return r124214;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r124215 = i;
        double r124216 = c;
        double r124217 = b;
        double r124218 = a;
        double r124219 = x;
        double r124220 = y;
        double r124221 = z;
        double r124222 = t;
        double r124223 = r124221 * r124222;
        double r124224 = fma(r124219, r124220, r124223);
        double r124225 = fma(r124217, r124218, r124224);
        double r124226 = fma(r124215, r124216, r124225);
        return r124226;
}

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