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 r126607 = x;
        double r126608 = y;
        double r126609 = r126607 * r126608;
        double r126610 = z;
        double r126611 = t;
        double r126612 = r126610 * r126611;
        double r126613 = r126609 + r126612;
        double r126614 = a;
        double r126615 = b;
        double r126616 = r126614 * r126615;
        double r126617 = r126613 + r126616;
        double r126618 = c;
        double r126619 = i;
        double r126620 = r126618 * r126619;
        double r126621 = r126617 + r126620;
        return r126621;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r126622 = i;
        double r126623 = c;
        double r126624 = t;
        double r126625 = z;
        double r126626 = a;
        double r126627 = b;
        double r126628 = x;
        double r126629 = y;
        double r126630 = r126628 * r126629;
        double r126631 = fma(r126626, r126627, r126630);
        double r126632 = fma(r126624, r126625, r126631);
        double r126633 = fma(r126622, r126623, r126632);
        return r126633;
}

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