function price = BS_fourier_call(S0,K,r,T,sigma,R,L,U)
    function y=mgf(z)
        y = exp((z*(r-sigma^2/2)+sigma^2*z^2/2)*T);
    endfunction
    function y=fourierpayoff(z)
        y = K^(1+complex(0,1)*z)/(complex(0,1)*z*(1+complex(0,1)*z));
    endfunction
    function y=integrand(u)
        y = real(S0^(complex(R,-u))*mgf(complex(R,-u))*fourierpayoff(complex(u,R))/(2*%pi));
    endfunction
    price = exp(-r*T)*intg(-L,U,integrand)
endfunction
