Average Error: 0.0 → 0.0
Time: 2.7s
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 r62576 = x;
        double r62577 = y;
        double r62578 = r62576 * r62577;
        double r62579 = z;
        double r62580 = t;
        double r62581 = r62579 * r62580;
        double r62582 = r62578 + r62581;
        double r62583 = a;
        double r62584 = b;
        double r62585 = r62583 * r62584;
        double r62586 = r62582 + r62585;
        double r62587 = c;
        double r62588 = i;
        double r62589 = r62587 * r62588;
        double r62590 = r62586 + r62589;
        return r62590;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r62591 = i;
        double r62592 = c;
        double r62593 = t;
        double r62594 = z;
        double r62595 = a;
        double r62596 = b;
        double r62597 = x;
        double r62598 = y;
        double r62599 = r62597 * r62598;
        double r62600 = fma(r62595, r62596, r62599);
        double r62601 = fma(r62593, r62594, r62600);
        double r62602 = fma(r62591, r62592, r62601);
        return r62602;
}

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