code: public static double margrabeExchangeOptionValue(
  			double spot1,
  			double spot2,
  			double volatility1,
  			double volatility2,
  			double correlation,
  			double optionMaturity)
  	{
  		double volatility = Math.sqrt(volatility1*volatility1 + volatility2*volatility2 - 2.0 * volatility1*volatility2*correlation);
  		return blackScholesGeneralizedOptionValue(spot1, volatility, optionMaturity, spot2, 1.0);
  	}
docs: Calculates the value of an Exchange option under a generalized Black-Scholes model, i.e., the payoff \( max(S_{1}(T)-S_{2}(T),0) \),
  where \( S_{1} \) and \( S_{2} \) follow a log-normal process with constant log-volatility and constant instantaneous correlation.
  
  The method also handles cases where the forward and/or option strike is negative
  and some limit cases where the forward and/or the option strike is zero.
  
  @param spot1 Value of \( S_{1}(0) \)
  @param spot2 Value of \( S_{2}(0) \)
  @param volatility1 Volatility of \( \log(S_{1}(t)) \)
  @param volatility2 Volatility of \( \log(S_{2}(t)) \)
  @param correlation Instantaneous correlation of \( \log(S_{1}(t)) \) and \( \log(S_{2}(t)) \)
  @param optionMaturity The option maturity \( T \).
  @return Returns the value of a European exchange option under the Black-Scholes model.