/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/BlackScholesHedgedPortfolio.java
final RandomVariable numeraireAssetsToSell  = stocksToBuy.mult( underlyingAtTimeIndex).add( hedgeOptionsToBuy.mult( numeraireAtEvaluationTime) ).div( numeraireAtTimeIndex) ;
final RandomVariable numeraireAssetsToSell  = stocksToBuy.mult ( underlyingAtTimeIndex ) .add ( hedgeOptionsToBuy.mult ( priceOfHedgeOption ) ) .div ( numeraireAtTimeIndex ) ;
break; } final RandomVariable hedgeOptionsToBuy = newNumberOfHedgeOptions.sub(amountOfHedgeOptions); delta = delta.sub(newNumberOfHedgeOptions.mult(deltaOfHedgeOption)); final RandomVariable newNumberOfStocks = delta; final RandomVariable stocksToBuy = newNumberOfStocks.sub(amountOfUnderlyingAsset); <extra_id_0> final RandomVariable newNumberOfNumeraireAsset = amountOfNumeraireAsset.sub(numeraireAssetsToSell); amountOfNumeraireAsset = newNumberOfNumeraireAsset; amountOfUnderlyingAsset = newNumberOfStocks; amountOfHedgeOptions = newNumberOfHedgeOptions; } final RandomVariable underlyingAtEvaluationTime = model.getAssetValue(evaluationTime,0);