Law of iterated logarithm says that $$\sup(W(t)) \sim \sqrt{2 t \log(\log(t))}.$$
Consider $\sup(W(t)) - \inf(W(t))$
my guess based on numerics that it should be
$$2\sqrt{\dfrac 2\pi} \sqrt{t \log(\log(t))}.$$
I guess it should be well-known ? Can one provide a reference ?
Matlab code for numerics
len = 1e7
iter = 100
for k=1:iter
d = randn(1,len);
v = cumsum(d);
mx = max(v);
mn = min(v);
dt(k,1) = mx-mn;
dt(k,2) = abs(v(end));
end;
fprintf('Mean(Max - min)/sqrt(len)/(2*sqrt(2/pi)) %f; Mean(Final)/sqrt(len)/sqrt(2/pi) %f ; mean/mean ratio %f \n',mean(dt(:,1) )/(2*sqrt(2/pi)) /sqrt(len) , mean(dt(:,2))/sqrt(len)/sqrt(2/pi), mean(dt(:,1) ) / mean(dt(:,2)) ) ;
Output:
Mean(Max - min)/sqrt(len)/(2*sqrt(2/pi)) 0.981920; Mean(Final)/sqrt(len)/sqrt(2/pi) 0.960711 ; mean/mean ratio 2.044153
The formula you use in your matlab program is different from the one you propose in the statments.
What you want to calculate can be derived theoretically. Let the running maximum be
$M_t = \sup_{s\in [0\ t]} W_t$
We know that pdf of $M_t$ is twice of that of $W_t$, but only defined on $[0 \ \infty)$. From this, you can calculate that
$E(M_t) = \sqrt{\frac{2t}{\pi}}$
and the running minimum is just the negative of that. Hence the formula you used in your code.