Average Error: 0.0 → 0.0
Time: 8.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 r87406 = x;
        double r87407 = y;
        double r87408 = r87406 * r87407;
        double r87409 = z;
        double r87410 = t;
        double r87411 = r87409 * r87410;
        double r87412 = r87408 + r87411;
        double r87413 = a;
        double r87414 = b;
        double r87415 = r87413 * r87414;
        double r87416 = r87412 + r87415;
        double r87417 = c;
        double r87418 = i;
        double r87419 = r87417 * r87418;
        double r87420 = r87416 + r87419;
        return r87420;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r87421 = c;
        double r87422 = i;
        double r87423 = a;
        double r87424 = b;
        double r87425 = x;
        double r87426 = y;
        double r87427 = z;
        double r87428 = t;
        double r87429 = r87427 * r87428;
        double r87430 = fma(r87425, r87426, r87429);
        double r87431 = fma(r87423, r87424, r87430);
        double r87432 = fma(r87421, r87422, r87431);
        return r87432;
}

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