Average Error: 0.0 → 0.0
Time: 7.9s
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 r104271 = x;
        double r104272 = y;
        double r104273 = r104271 * r104272;
        double r104274 = z;
        double r104275 = t;
        double r104276 = r104274 * r104275;
        double r104277 = r104273 + r104276;
        double r104278 = a;
        double r104279 = b;
        double r104280 = r104278 * r104279;
        double r104281 = r104277 + r104280;
        double r104282 = c;
        double r104283 = i;
        double r104284 = r104282 * r104283;
        double r104285 = r104281 + r104284;
        return r104285;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r104286 = c;
        double r104287 = i;
        double r104288 = a;
        double r104289 = b;
        double r104290 = x;
        double r104291 = y;
        double r104292 = z;
        double r104293 = t;
        double r104294 = r104292 * r104293;
        double r104295 = fma(r104290, r104291, r104294);
        double r104296 = fma(r104288, r104289, r104295);
        double r104297 = fma(r104286, r104287, r104296);
        return r104297;
}

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