I'm doing a simple OLS regression and I strikes my attention that this very simple computation takes several seconds to perform in Mathematica
Sum[(x[[i]] - Mean[x]) (y[[i]] - Mean[y]), {i, 1, 40}]/ Sum[(x[[i]] - Mean[x])^2, {i, 1, 40}]
The equivalent in Maple is instantaneous:
(sum((x[i]-Mean(x))*(y[i]-Mean(y)), i = 1 .. 40))/(sum((x[i]-Mean(x))^2, i = 1 .. 40))
Am I doing something wrong?