Average Error: 0.0 → 0.0
Time: 9.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 r141343 = x;
        double r141344 = y;
        double r141345 = r141343 * r141344;
        double r141346 = z;
        double r141347 = t;
        double r141348 = r141346 * r141347;
        double r141349 = r141345 + r141348;
        double r141350 = a;
        double r141351 = b;
        double r141352 = r141350 * r141351;
        double r141353 = r141349 + r141352;
        double r141354 = c;
        double r141355 = i;
        double r141356 = r141354 * r141355;
        double r141357 = r141353 + r141356;
        return r141357;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r141358 = c;
        double r141359 = i;
        double r141360 = a;
        double r141361 = b;
        double r141362 = x;
        double r141363 = y;
        double r141364 = z;
        double r141365 = t;
        double r141366 = r141364 * r141365;
        double r141367 = fma(r141362, r141363, r141366);
        double r141368 = fma(r141360, r141361, r141367);
        double r141369 = fma(r141358, r141359, r141368);
        return r141369;
}

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