Average Error: 0.0 → 0.0
Time: 6.6s
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 r161158 = x;
        double r161159 = y;
        double r161160 = r161158 * r161159;
        double r161161 = z;
        double r161162 = t;
        double r161163 = r161161 * r161162;
        double r161164 = r161160 + r161163;
        double r161165 = a;
        double r161166 = b;
        double r161167 = r161165 * r161166;
        double r161168 = r161164 + r161167;
        double r161169 = c;
        double r161170 = i;
        double r161171 = r161169 * r161170;
        double r161172 = r161168 + r161171;
        return r161172;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r161173 = i;
        double r161174 = c;
        double r161175 = b;
        double r161176 = a;
        double r161177 = x;
        double r161178 = y;
        double r161179 = z;
        double r161180 = t;
        double r161181 = r161179 * r161180;
        double r161182 = fma(r161177, r161178, r161181);
        double r161183 = fma(r161175, r161176, r161182);
        double r161184 = fma(r161173, r161174, r161183);
        return r161184;
}

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