Average Error: 0.0 → 0.0
Time: 1.8s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\left(\mathsf{fma}\left(t, z, x \cdot y\right) + a \cdot b\right) + c \cdot i\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\left(\mathsf{fma}\left(t, z, x \cdot y\right) + a \cdot b\right) + c \cdot i
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r66113 = x;
        double r66114 = y;
        double r66115 = r66113 * r66114;
        double r66116 = z;
        double r66117 = t;
        double r66118 = r66116 * r66117;
        double r66119 = r66115 + r66118;
        double r66120 = a;
        double r66121 = b;
        double r66122 = r66120 * r66121;
        double r66123 = r66119 + r66122;
        double r66124 = c;
        double r66125 = i;
        double r66126 = r66124 * r66125;
        double r66127 = r66123 + r66126;
        return r66127;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r66128 = t;
        double r66129 = z;
        double r66130 = x;
        double r66131 = y;
        double r66132 = r66130 * r66131;
        double r66133 = fma(r66128, r66129, r66132);
        double r66134 = a;
        double r66135 = b;
        double r66136 = r66134 * r66135;
        double r66137 = r66133 + r66136;
        double r66138 = c;
        double r66139 = i;
        double r66140 = r66138 * r66139;
        double r66141 = r66137 + r66140;
        return r66141;
}

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. Taylor expanded around inf 0.0

    \[\leadsto \left(\color{blue}{\left(t \cdot z + x \cdot y\right)} + a \cdot b\right) + c \cdot i\]
  3. Simplified0.0

    \[\leadsto \left(\color{blue}{\mathsf{fma}\left(t, z, x \cdot y\right)} + a \cdot b\right) + c \cdot i\]
  4. Final simplification0.0

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

Reproduce

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