Average Error: 0.0 → 0.0
Time: 2.1s
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 r114295 = x;
        double r114296 = y;
        double r114297 = r114295 * r114296;
        double r114298 = z;
        double r114299 = t;
        double r114300 = r114298 * r114299;
        double r114301 = r114297 + r114300;
        double r114302 = a;
        double r114303 = b;
        double r114304 = r114302 * r114303;
        double r114305 = r114301 + r114304;
        double r114306 = c;
        double r114307 = i;
        double r114308 = r114306 * r114307;
        double r114309 = r114305 + r114308;
        return r114309;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r114310 = i;
        double r114311 = c;
        double r114312 = b;
        double r114313 = a;
        double r114314 = x;
        double r114315 = y;
        double r114316 = z;
        double r114317 = t;
        double r114318 = r114316 * r114317;
        double r114319 = fma(r114314, r114315, r114318);
        double r114320 = fma(r114312, r114313, r114319);
        double r114321 = fma(r114310, r114311, r114320);
        return r114321;
}

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