code: public static double blackScholesGeneralizedOptionVega(
  			double forward,
  			double volatility,
  			double optionMaturity,
  			double optionStrike,
  			double payoffUnit)
  	{
  		if(optionStrike <= 0.0 || optionMaturity <= 0.0)
  		{
  			// The Black-Scholes model does not consider it being an option
  			return 0.0;
  		}
  		else
  		{
  			// Calculate vega
  			double dPlus = (Math.log(forward / optionStrike) + (0.5 * volatility * volatility) * optionMaturity) / (volatility * Math.sqrt(optionMaturity));
  
  			double vega = payoffUnit * NormalDistribution.density(dPlus) * forward * Math.sqrt(optionMaturity);
  
  			return vega;
  		}
  	}
docs: Calculates the vega of a call, i.e., the payoff max(S(T)-K,0) P, where S follows a
  normal process with constant volatility, i.e., a Black-Scholes model
  \[
  \mathrm{d} S(t) = r S(t) \mathrm{d} t + \sigma S(t)\mathrm{d}W(t)
  \]
  
  @param forward The forward of the underlying \( F = S(T) \exp(r T) \).
  @param volatility The Black-Scholes volatility \( \sigma \).
  @param optionMaturity The option maturity T.
  @param optionStrike The option strike.
  @param payoffUnit The payoff unit (e.g., the discount factor)
  @return Returns the vega of a European call option under the Black-Scholes model.