Average Error: 0.0 → 0.0
Time: 17.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(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 r89284 = x;
        double r89285 = y;
        double r89286 = r89284 * r89285;
        double r89287 = z;
        double r89288 = t;
        double r89289 = r89287 * r89288;
        double r89290 = r89286 + r89289;
        double r89291 = a;
        double r89292 = b;
        double r89293 = r89291 * r89292;
        double r89294 = r89290 + r89293;
        double r89295 = c;
        double r89296 = i;
        double r89297 = r89295 * r89296;
        double r89298 = r89294 + r89297;
        return r89298;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r89299 = c;
        double r89300 = i;
        double r89301 = t;
        double r89302 = z;
        double r89303 = a;
        double r89304 = b;
        double r89305 = x;
        double r89306 = y;
        double r89307 = r89305 * r89306;
        double r89308 = fma(r89303, r89304, r89307);
        double r89309 = fma(r89301, r89302, r89308);
        double r89310 = fma(r89299, r89300, r89309);
        return r89310;
}

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, C"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))