Average Error: 0.0 → 0.0
Time: 12.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(a, b, \mathsf{fma}\left(z, t, y \cdot x\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(a, b, \mathsf{fma}\left(z, t, y \cdot x\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4751183 = x;
        double r4751184 = y;
        double r4751185 = r4751183 * r4751184;
        double r4751186 = z;
        double r4751187 = t;
        double r4751188 = r4751186 * r4751187;
        double r4751189 = r4751185 + r4751188;
        double r4751190 = a;
        double r4751191 = b;
        double r4751192 = r4751190 * r4751191;
        double r4751193 = r4751189 + r4751192;
        double r4751194 = c;
        double r4751195 = i;
        double r4751196 = r4751194 * r4751195;
        double r4751197 = r4751193 + r4751196;
        return r4751197;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r4751198 = i;
        double r4751199 = c;
        double r4751200 = a;
        double r4751201 = b;
        double r4751202 = z;
        double r4751203 = t;
        double r4751204 = y;
        double r4751205 = x;
        double r4751206 = r4751204 * r4751205;
        double r4751207 = fma(r4751202, r4751203, r4751206);
        double r4751208 = fma(r4751200, r4751201, r4751207);
        double r4751209 = fma(r4751198, r4751199, r4751208);
        return r4751209;
}

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

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

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

    \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(a, b, \mathsf{fma}\left(z, t, y \cdot x\right)\right)\right)\]

Reproduce

herbie shell --seed 2019171 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))