Average Error: 0.0 → 0.0
Time: 1.8s
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 r114539 = x;
        double r114540 = y;
        double r114541 = r114539 * r114540;
        double r114542 = z;
        double r114543 = t;
        double r114544 = r114542 * r114543;
        double r114545 = r114541 + r114544;
        double r114546 = a;
        double r114547 = b;
        double r114548 = r114546 * r114547;
        double r114549 = r114545 + r114548;
        double r114550 = c;
        double r114551 = i;
        double r114552 = r114550 * r114551;
        double r114553 = r114549 + r114552;
        return r114553;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r114554 = i;
        double r114555 = c;
        double r114556 = t;
        double r114557 = z;
        double r114558 = a;
        double r114559 = b;
        double r114560 = x;
        double r114561 = y;
        double r114562 = r114560 * r114561;
        double r114563 = fma(r114558, r114559, r114562);
        double r114564 = fma(r114556, r114557, r114563);
        double r114565 = fma(r114554, r114555, r114564);
        return r114565;
}

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 2020018 +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)))