Average Error: 0.0 → 0.0
Time: 17.5s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(c, i, \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(c, i, \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 r70106 = x;
        double r70107 = y;
        double r70108 = r70106 * r70107;
        double r70109 = z;
        double r70110 = t;
        double r70111 = r70109 * r70110;
        double r70112 = r70108 + r70111;
        double r70113 = a;
        double r70114 = b;
        double r70115 = r70113 * r70114;
        double r70116 = r70112 + r70115;
        double r70117 = c;
        double r70118 = i;
        double r70119 = r70117 * r70118;
        double r70120 = r70116 + r70119;
        return r70120;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r70121 = c;
        double r70122 = i;
        double r70123 = t;
        double r70124 = z;
        double r70125 = a;
        double r70126 = b;
        double r70127 = x;
        double r70128 = y;
        double r70129 = r70127 * r70128;
        double r70130 = fma(r70125, r70126, r70129);
        double r70131 = fma(r70123, r70124, r70130);
        double r70132 = fma(r70121, r70122, r70131);
        return r70132;
}

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(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Taylor expanded around inf 0.0

    \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{t \cdot z + \left(a \cdot b + x \cdot y\right)}\right)\]
  4. Simplified0.0

    \[\leadsto \mathsf{fma}\left(c, i, \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(c, i, \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)\]

Reproduce

herbie shell --seed 2019209 +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)))