Average Error: 0.0 → 0.0
Time: 2.3s
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 r48252 = x;
        double r48253 = y;
        double r48254 = r48252 * r48253;
        double r48255 = z;
        double r48256 = t;
        double r48257 = r48255 * r48256;
        double r48258 = r48254 + r48257;
        double r48259 = a;
        double r48260 = b;
        double r48261 = r48259 * r48260;
        double r48262 = r48258 + r48261;
        double r48263 = c;
        double r48264 = i;
        double r48265 = r48263 * r48264;
        double r48266 = r48262 + r48265;
        return r48266;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r48267 = i;
        double r48268 = c;
        double r48269 = t;
        double r48270 = z;
        double r48271 = a;
        double r48272 = b;
        double r48273 = x;
        double r48274 = y;
        double r48275 = r48273 * r48274;
        double r48276 = fma(r48271, r48272, r48275);
        double r48277 = fma(r48269, r48270, r48276);
        double r48278 = fma(r48267, r48268, r48277);
        return r48278;
}

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