Average Error: 0.0 → 0.0
Time: 2.9s
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 r159146 = x;
        double r159147 = y;
        double r159148 = r159146 * r159147;
        double r159149 = z;
        double r159150 = t;
        double r159151 = r159149 * r159150;
        double r159152 = r159148 + r159151;
        double r159153 = a;
        double r159154 = b;
        double r159155 = r159153 * r159154;
        double r159156 = r159152 + r159155;
        double r159157 = c;
        double r159158 = i;
        double r159159 = r159157 * r159158;
        double r159160 = r159156 + r159159;
        return r159160;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r159161 = i;
        double r159162 = c;
        double r159163 = b;
        double r159164 = a;
        double r159165 = x;
        double r159166 = y;
        double r159167 = z;
        double r159168 = t;
        double r159169 = r159167 * r159168;
        double r159170 = fma(r159165, r159166, r159169);
        double r159171 = fma(r159163, r159164, r159170);
        double r159172 = fma(r159161, r159162, r159171);
        return r159172;
}

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