Average Error: 0.0 → 0.0
Time: 3.9s
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(b, a, \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(i, c, \mathsf{fma}\left(b, a, \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 r73288 = x;
        double r73289 = y;
        double r73290 = r73288 * r73289;
        double r73291 = z;
        double r73292 = t;
        double r73293 = r73291 * r73292;
        double r73294 = r73290 + r73293;
        double r73295 = a;
        double r73296 = b;
        double r73297 = r73295 * r73296;
        double r73298 = r73294 + r73297;
        double r73299 = c;
        double r73300 = i;
        double r73301 = r73299 * r73300;
        double r73302 = r73298 + r73301;
        return r73302;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r73303 = i;
        double r73304 = c;
        double r73305 = b;
        double r73306 = a;
        double r73307 = x;
        double r73308 = y;
        double r73309 = z;
        double r73310 = t;
        double r73311 = r73309 * r73310;
        double r73312 = fma(r73307, r73308, r73311);
        double r73313 = fma(r73305, r73306, r73312);
        double r73314 = fma(r73303, r73304, r73313);
        return r73314;
}

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

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

Reproduce

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