/src/main/java/net/finmath/montecarlo/interestrate/products/FlexiCap.java
payoff = numeraire.div( payoff).mult( monteCarloProbabilities) ;
payoff = payoff.div ( numeraire ) .mult ( monteCarloProbabilities ) ;
final RandomVariable libor = model.getForwardRate(fixingDate, fixingDate, paymentDate); final RandomVariable numeraire = model.getNumeraire(paymentDate); final RandomVariable monteCarloProbabilities = model.getMonteCarloWeights(model.getTimeIndex(paymentDate)); RandomVariable payoff = libor.sub(strike).mult(periodLength); RandomVariable indicator = payoff.choose(new RandomVariableFromDoubleArray(1.0), new RandomVariableFromDoubleArray(0.0)); indicator = numberOfExcercises.choose(indicator, new Scalar(0.0)); <extra_id_0> values = values.addProduct(indicator, payoff); numberOfExcercises = numberOfExcercises.sub(indicator); } final RandomVariable numeraireAtEvaluationTime = model.getNumeraire(evaluationTime); final RandomVariable monteCarloProbabilitiesAtEvaluationTime = model.getMonteCarloWeights(evaluationTime); values = values.mult(numeraireAtEvaluationTime).div(monteCarloProbabilitiesAtEvaluationTime);