Average Error: 0.0 → 0.0
Time: 8.7s
Precision: 64
\[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\]
\[\mathsf{fma}\left(c, i, \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)\]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\mathsf{fma}\left(c, i, \mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\right)
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r114852 = x;
        double r114853 = y;
        double r114854 = r114852 * r114853;
        double r114855 = z;
        double r114856 = t;
        double r114857 = r114855 * r114856;
        double r114858 = r114854 + r114857;
        double r114859 = a;
        double r114860 = b;
        double r114861 = r114859 * r114860;
        double r114862 = r114858 + r114861;
        double r114863 = c;
        double r114864 = i;
        double r114865 = r114863 * r114864;
        double r114866 = r114862 + r114865;
        return r114866;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i) {
        double r114867 = c;
        double r114868 = i;
        double r114869 = t;
        double r114870 = z;
        double r114871 = a;
        double r114872 = b;
        double r114873 = x;
        double r114874 = y;
        double r114875 = r114873 * r114874;
        double r114876 = fma(r114871, r114872, r114875);
        double r114877 = fma(r114869, r114870, r114876);
        double r114878 = fma(r114867, r114868, r114877);
        return r114878;
}

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(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)}\]
  3. Taylor expanded around inf 0.0

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

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

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

Reproduce

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