Average Error: 0.0 → 0.0
Time: 30.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(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 r6218099 = x;
        double r6218100 = y;
        double r6218101 = r6218099 * r6218100;
        double r6218102 = z;
        double r6218103 = t;
        double r6218104 = r6218102 * r6218103;
        double r6218105 = r6218101 + r6218104;
        double r6218106 = a;
        double r6218107 = b;
        double r6218108 = r6218106 * r6218107;
        double r6218109 = r6218105 + r6218108;
        double r6218110 = c;
        double r6218111 = i;
        double r6218112 = r6218110 * r6218111;
        double r6218113 = r6218109 + r6218112;
        return r6218113;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r6218114 = i;
        double r6218115 = c;
        double r6218116 = a;
        double r6218117 = b;
        double r6218118 = x;
        double r6218119 = y;
        double r6218120 = z;
        double r6218121 = t;
        double r6218122 = r6218120 * r6218121;
        double r6218123 = fma(r6218118, r6218119, r6218122);
        double r6218124 = fma(r6218116, r6218117, r6218123);
        double r6218125 = fma(r6218114, r6218115, r6218124);
        return r6218125;
}

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"
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))