function option_price
  S = 100.0; % Price of underlying asset
  K = 90.0;  % Strike price
  T = 1.5;   % Time to maturity in years
  r = 0.03;  % Risk-free interest rate
  q = 0.015; % Dividend rate
  sigma = 0.09;  % Volatility of underlying asset - N.B. 0.09 means 9%
  [price] = bs(S, K, T, r, q, sigma);
  fprintf('Option price is %g\n', price);
end

% A function to compute the European option price given by the
% Black-Scholes-Merton formula, for a "Call" option.
function [price] = bs(S, K, T, r, q, sigma)
    calput = 'Call';
    [p, ifail] = nag_specfun_opt_bsm_price(calput,K,S,T,sigma,r,q);
    price = p;
end
