Average Error: 0.0 → 0.0
Time: 31.8s
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(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(i, c, \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 r10017122 = x;
        double r10017123 = y;
        double r10017124 = r10017122 * r10017123;
        double r10017125 = z;
        double r10017126 = t;
        double r10017127 = r10017125 * r10017126;
        double r10017128 = r10017124 + r10017127;
        double r10017129 = a;
        double r10017130 = b;
        double r10017131 = r10017129 * r10017130;
        double r10017132 = r10017128 + r10017131;
        double r10017133 = c;
        double r10017134 = i;
        double r10017135 = r10017133 * r10017134;
        double r10017136 = r10017132 + r10017135;
        return r10017136;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r10017137 = i;
        double r10017138 = c;
        double r10017139 = a;
        double r10017140 = b;
        double r10017141 = x;
        double r10017142 = y;
        double r10017143 = z;
        double r10017144 = t;
        double r10017145 = r10017143 * r10017144;
        double r10017146 = fma(r10017141, r10017142, r10017145);
        double r10017147 = fma(r10017139, r10017140, r10017146);
        double r10017148 = fma(r10017137, r10017138, r10017147);
        return r10017148;
}

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(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\]

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))