Average Error: 0.0 → 0.0
Time: 4.0s
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 r80194 = x;
        double r80195 = y;
        double r80196 = r80194 * r80195;
        double r80197 = z;
        double r80198 = t;
        double r80199 = r80197 * r80198;
        double r80200 = r80196 + r80199;
        double r80201 = a;
        double r80202 = b;
        double r80203 = r80201 * r80202;
        double r80204 = r80200 + r80203;
        double r80205 = c;
        double r80206 = i;
        double r80207 = r80205 * r80206;
        double r80208 = r80204 + r80207;
        return r80208;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r80209 = i;
        double r80210 = c;
        double r80211 = b;
        double r80212 = a;
        double r80213 = x;
        double r80214 = y;
        double r80215 = z;
        double r80216 = t;
        double r80217 = r80215 * r80216;
        double r80218 = fma(r80213, r80214, r80217);
        double r80219 = fma(r80211, r80212, r80218);
        double r80220 = fma(r80209, r80210, r80219);
        return r80220;
}

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 2020047 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))