Average Error: 0.0 → 0.0
Time: 5.0s
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(a, b, \mathsf{fma}\left(x, y, z \cdot t\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(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r148244 = x;
        double r148245 = y;
        double r148246 = r148244 * r148245;
        double r148247 = z;
        double r148248 = t;
        double r148249 = r148247 * r148248;
        double r148250 = r148246 + r148249;
        double r148251 = a;
        double r148252 = b;
        double r148253 = r148251 * r148252;
        double r148254 = r148250 + r148253;
        double r148255 = c;
        double r148256 = i;
        double r148257 = r148255 * r148256;
        double r148258 = r148254 + r148257;
        return r148258;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r148259 = c;
        double r148260 = i;
        double r148261 = a;
        double r148262 = b;
        double r148263 = x;
        double r148264 = y;
        double r148265 = z;
        double r148266 = t;
        double r148267 = r148265 * r148266;
        double r148268 = fma(r148263, r148264, r148267);
        double r148269 = fma(r148261, r148262, r148268);
        double r148270 = fma(r148259, r148260, r148269);
        return r148270;
}

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. Final simplification0.0

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

Reproduce

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