Average Error: 0.0 → 0.0
Time: 27.3s
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(z, t, \mathsf{fma}\left(y, x, b \cdot a\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(z, t, \mathsf{fma}\left(y, x, b \cdot a\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r5424403 = x;
        double r5424404 = y;
        double r5424405 = r5424403 * r5424404;
        double r5424406 = z;
        double r5424407 = t;
        double r5424408 = r5424406 * r5424407;
        double r5424409 = r5424405 + r5424408;
        double r5424410 = a;
        double r5424411 = b;
        double r5424412 = r5424410 * r5424411;
        double r5424413 = r5424409 + r5424412;
        double r5424414 = c;
        double r5424415 = i;
        double r5424416 = r5424414 * r5424415;
        double r5424417 = r5424413 + r5424416;
        return r5424417;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r5424418 = i;
        double r5424419 = c;
        double r5424420 = z;
        double r5424421 = t;
        double r5424422 = y;
        double r5424423 = x;
        double r5424424 = b;
        double r5424425 = a;
        double r5424426 = r5424424 * r5424425;
        double r5424427 = fma(r5424422, r5424423, r5424426);
        double r5424428 = fma(r5424420, r5424421, r5424427);
        double r5424429 = fma(r5424418, r5424419, r5424428);
        return r5424429;
}

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(a, b, \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}{a \cdot b + \left(t \cdot z + x \cdot y\right)}\right)\]
  4. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))