// Calculate the Black Scholes European put option Vega
double BS_Put_Option_Vega(double S, double K, double r, double v, double T)
// Parameters: (S = Current Stock Price, K = Strike Price, r = Risk-Free Rate, v = Volatility of Stock Price, T = Time to Maturity)
{ return BS_Call_Option_Vega(S, K, r, v, T); } // Identical to call via put-call parity

// Calculate the Black Scholes European call option Vega
double BS_Call_Option_Vega(double S, double K, double r, double v, double T)
// Parameters: (S = Current Stock Price, K = Strike Price, r = Risk-Free Rate, v = Volatility of Stock Price, T = Time to Maturity)
{ return S * Normal_PDF(d_j(1, S, K, r, v, T)) * sqrt(T); }

const double Pi = 3.14159265359;
// Standard Normal probability density function
double Normal_PDF(const double & x)
// Normal PDF(x) = exp(-x*x/2)/{sigma * sqrt(2 * Pi) }
{ return (1.0/(double)pow(2 * Pi, 0.5)) * exp(-0.5 * x * x); }

*Related Posts*