Average Error: 0.0 → 0.0
Time: 17.5s
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(x, y, a \cdot b\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(x, y, a \cdot b\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r6049376 = x;
        double r6049377 = y;
        double r6049378 = r6049376 * r6049377;
        double r6049379 = z;
        double r6049380 = t;
        double r6049381 = r6049379 * r6049380;
        double r6049382 = r6049378 + r6049381;
        double r6049383 = a;
        double r6049384 = b;
        double r6049385 = r6049383 * r6049384;
        double r6049386 = r6049382 + r6049385;
        double r6049387 = c;
        double r6049388 = i;
        double r6049389 = r6049387 * r6049388;
        double r6049390 = r6049386 + r6049389;
        return r6049390;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r6049391 = i;
        double r6049392 = c;
        double r6049393 = z;
        double r6049394 = t;
        double r6049395 = x;
        double r6049396 = y;
        double r6049397 = a;
        double r6049398 = b;
        double r6049399 = r6049397 * r6049398;
        double r6049400 = fma(r6049395, r6049396, r6049399);
        double r6049401 = fma(r6049393, r6049394, r6049400);
        double r6049402 = fma(r6049391, r6049392, r6049401);
        return r6049402;
}

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(y, x, \mathsf{fma}\left(b, a, z \cdot t\right)\right)\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.0

    \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(y, x, \color{blue}{b \cdot a + z \cdot t}\right)\right)\]
  5. 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)\]
  6. Simplified0.0

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

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

Reproduce

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