Average Error: 0.0 → 0.0
Time: 3.6s
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(t, z, \mathsf{fma}\left(a, b, x \cdot y\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(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r154369 = x;
        double r154370 = y;
        double r154371 = r154369 * r154370;
        double r154372 = z;
        double r154373 = t;
        double r154374 = r154372 * r154373;
        double r154375 = r154371 + r154374;
        double r154376 = a;
        double r154377 = b;
        double r154378 = r154376 * r154377;
        double r154379 = r154375 + r154378;
        double r154380 = c;
        double r154381 = i;
        double r154382 = r154380 * r154381;
        double r154383 = r154379 + r154382;
        return r154383;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r154384 = i;
        double r154385 = c;
        double r154386 = t;
        double r154387 = z;
        double r154388 = a;
        double r154389 = b;
        double r154390 = x;
        double r154391 = y;
        double r154392 = r154390 * r154391;
        double r154393 = fma(r154388, r154389, r154392);
        double r154394 = fma(r154386, r154387, r154393);
        double r154395 = fma(r154384, r154385, r154394);
        return r154395;
}

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. Taylor expanded around inf 0.0

    \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{t \cdot z + \left(a \cdot b + x \cdot y\right)}\right)\]
  4. Simplified0.0

    \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)}\right)\]
  5. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)\]

Reproduce

herbie shell --seed 2020060 +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)))