Average Error: 0.0 → 0.0
Time: 14.1s
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 r100241 = x;
        double r100242 = y;
        double r100243 = r100241 * r100242;
        double r100244 = z;
        double r100245 = t;
        double r100246 = r100244 * r100245;
        double r100247 = r100243 + r100246;
        double r100248 = a;
        double r100249 = b;
        double r100250 = r100248 * r100249;
        double r100251 = r100247 + r100250;
        double r100252 = c;
        double r100253 = i;
        double r100254 = r100252 * r100253;
        double r100255 = r100251 + r100254;
        return r100255;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r100256 = c;
        double r100257 = i;
        double r100258 = a;
        double r100259 = b;
        double r100260 = x;
        double r100261 = y;
        double r100262 = z;
        double r100263 = t;
        double r100264 = r100262 * r100263;
        double r100265 = fma(r100260, r100261, r100264);
        double r100266 = fma(r100258, r100259, r100265);
        double r100267 = fma(r100256, r100257, r100266);
        return r100267;
}

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