Average Error: 0.0 → 0.0
Time: 30.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(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 r4237519 = x;
        double r4237520 = y;
        double r4237521 = r4237519 * r4237520;
        double r4237522 = z;
        double r4237523 = t;
        double r4237524 = r4237522 * r4237523;
        double r4237525 = r4237521 + r4237524;
        double r4237526 = a;
        double r4237527 = b;
        double r4237528 = r4237526 * r4237527;
        double r4237529 = r4237525 + r4237528;
        double r4237530 = c;
        double r4237531 = i;
        double r4237532 = r4237530 * r4237531;
        double r4237533 = r4237529 + r4237532;
        return r4237533;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4237534 = i;
        double r4237535 = c;
        double r4237536 = z;
        double r4237537 = t;
        double r4237538 = y;
        double r4237539 = x;
        double r4237540 = b;
        double r4237541 = a;
        double r4237542 = r4237540 * r4237541;
        double r4237543 = fma(r4237538, r4237539, r4237542);
        double r4237544 = fma(r4237536, r4237537, r4237543);
        double r4237545 = fma(r4237534, r4237535, r4237544);
        return r4237545;
}

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"
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))