Average Error: 0.0 → 0.0
Time: 15.1s
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 r116384 = x;
        double r116385 = y;
        double r116386 = r116384 * r116385;
        double r116387 = z;
        double r116388 = t;
        double r116389 = r116387 * r116388;
        double r116390 = r116386 + r116389;
        double r116391 = a;
        double r116392 = b;
        double r116393 = r116391 * r116392;
        double r116394 = r116390 + r116393;
        double r116395 = c;
        double r116396 = i;
        double r116397 = r116395 * r116396;
        double r116398 = r116394 + r116397;
        return r116398;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r116399 = c;
        double r116400 = i;
        double r116401 = a;
        double r116402 = b;
        double r116403 = x;
        double r116404 = y;
        double r116405 = z;
        double r116406 = t;
        double r116407 = r116405 * r116406;
        double r116408 = fma(r116403, r116404, r116407);
        double r116409 = fma(r116401, r116402, r116408);
        double r116410 = fma(r116399, r116400, r116409);
        return r116410;
}

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