Average Error: 0.0 → 0.0
Time: 6.2s
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 r383 = x;
        double r384 = y;
        double r385 = r383 * r384;
        double r386 = z;
        double r387 = t;
        double r388 = r386 * r387;
        double r389 = r385 + r388;
        double r390 = a;
        double r391 = b;
        double r392 = r390 * r391;
        double r393 = r389 + r392;
        double r394 = c;
        double r395 = i;
        double r396 = r394 * r395;
        double r397 = r393 + r396;
        return r397;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r398 = i;
        double r399 = c;
        double r400 = b;
        double r401 = a;
        double r402 = x;
        double r403 = y;
        double r404 = z;
        double r405 = t;
        double r406 = r404 * r405;
        double r407 = fma(r402, r403, r406);
        double r408 = fma(r400, r401, r407);
        double r409 = fma(r398, r399, r408);
        return r409;
}

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 2020025 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))