function y=extrap(f,w);
%EXTRAP    use a weighted average of the nearest 3 slopes to find an 
%          extrapolated point y.

f1 = f(1);
f2 = f(2);
f3 = f(3);
f4 = f(4);
w1 = w(1);
w2 = w(2);
w3 = w(3);
y  = f4 + w1*(f2-f1)+w2*(f3-f2)+w3*(f4-f3);

