Average Error: 0.0 → 0.0
Time: 16.3s
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, t \cdot z\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, t \cdot z\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r6260149 = x;
        double r6260150 = y;
        double r6260151 = r6260149 * r6260150;
        double r6260152 = z;
        double r6260153 = t;
        double r6260154 = r6260152 * r6260153;
        double r6260155 = r6260151 + r6260154;
        double r6260156 = a;
        double r6260157 = b;
        double r6260158 = r6260156 * r6260157;
        double r6260159 = r6260155 + r6260158;
        double r6260160 = c;
        double r6260161 = i;
        double r6260162 = r6260160 * r6260161;
        double r6260163 = r6260159 + r6260162;
        return r6260163;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r6260164 = i;
        double r6260165 = c;
        double r6260166 = a;
        double r6260167 = b;
        double r6260168 = x;
        double r6260169 = y;
        double r6260170 = t;
        double r6260171 = z;
        double r6260172 = r6260170 * r6260171;
        double r6260173 = fma(r6260168, r6260169, r6260172);
        double r6260174 = fma(r6260166, r6260167, r6260173);
        double r6260175 = fma(r6260164, r6260165, r6260174);
        return r6260175;
}

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, t \cdot z\right)\right)\right)\]

Reproduce

herbie shell --seed 2019192 +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)))