Average Error: 0.0 → 0.0
Time: 17.7s
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 r104115 = x;
        double r104116 = y;
        double r104117 = r104115 * r104116;
        double r104118 = z;
        double r104119 = t;
        double r104120 = r104118 * r104119;
        double r104121 = r104117 + r104120;
        double r104122 = a;
        double r104123 = b;
        double r104124 = r104122 * r104123;
        double r104125 = r104121 + r104124;
        double r104126 = c;
        double r104127 = i;
        double r104128 = r104126 * r104127;
        double r104129 = r104125 + r104128;
        return r104129;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r104130 = c;
        double r104131 = i;
        double r104132 = a;
        double r104133 = b;
        double r104134 = x;
        double r104135 = y;
        double r104136 = z;
        double r104137 = t;
        double r104138 = r104136 * r104137;
        double r104139 = fma(r104134, r104135, r104138);
        double r104140 = fma(r104132, r104133, r104139);
        double r104141 = fma(r104130, r104131, r104140);
        return r104141;
}

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