function [c,p,d1,d2,Delta,Gamma,Theta] = BlackScholes01(s0,E,T,r,sigma) ;
% c = call price
% p = put price
% d1, d2 = quantities in Black-Scholes formula
% Delta, Gamma, Theta = three of the Greeks

% Usage: [c,p,d1,d2,Delta,Gamma,Theta] = BlackScholes01(s0,E,T,r,sigma) ;

d1a= log(s0./E) + (r+(sigma.^2)./2) .*T  ;
sqrtT = sqrt(T) ;
d1b =  sigma.*sqrtT  ;
d1=d1a ./ d1b ;
d2 = d1 - sigma.*sqrtT ;
c = cdfn(d1).*s0 - cdfn(d2).*E.*exp(-r.*T) ;

p = c + exp(-r.*T).*E - s0 ;
Delta = cdfn(d1) ;
Gamma = pdfn(d1) ./ (s0*sigma*sqrtT) ;
Theta = -s0.*sigma.*pdfn(d1) ./ (2*sqrtT) - E.*r.*exp(-r.*T).*cdfn(d2) ;