Average Error: 0.0 → 0.0
Time: 6.2s
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 r113443 = x;
        double r113444 = y;
        double r113445 = r113443 * r113444;
        double r113446 = z;
        double r113447 = t;
        double r113448 = r113446 * r113447;
        double r113449 = r113445 + r113448;
        double r113450 = a;
        double r113451 = b;
        double r113452 = r113450 * r113451;
        double r113453 = r113449 + r113452;
        double r113454 = c;
        double r113455 = i;
        double r113456 = r113454 * r113455;
        double r113457 = r113453 + r113456;
        return r113457;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r113458 = c;
        double r113459 = i;
        double r113460 = a;
        double r113461 = b;
        double r113462 = x;
        double r113463 = y;
        double r113464 = z;
        double r113465 = t;
        double r113466 = r113464 * r113465;
        double r113467 = fma(r113462, r113463, r113466);
        double r113468 = fma(r113460, r113461, r113467);
        double r113469 = fma(r113458, r113459, r113468);
        return r113469;
}

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