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 r64385 = x;
        double r64386 = y;
        double r64387 = r64385 * r64386;
        double r64388 = z;
        double r64389 = t;
        double r64390 = r64388 * r64389;
        double r64391 = r64387 + r64390;
        double r64392 = a;
        double r64393 = b;
        double r64394 = r64392 * r64393;
        double r64395 = r64391 + r64394;
        double r64396 = c;
        double r64397 = i;
        double r64398 = r64396 * r64397;
        double r64399 = r64395 + r64398;
        return r64399;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r64400 = i;
        double r64401 = c;
        double r64402 = t;
        double r64403 = z;
        double r64404 = a;
        double r64405 = b;
        double r64406 = x;
        double r64407 = y;
        double r64408 = r64406 * r64407;
        double r64409 = fma(r64404, r64405, r64408);
        double r64410 = fma(r64402, r64403, r64409);
        double r64411 = fma(r64400, r64401, r64410);
        return r64411;
}

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