/src/main/java/net/finmath/marketdata/products/Swap.java
final double forward  = payment.getForward( model, fixing, forwardCurve-fixing) ;
final double forward  = forwardCurve.getForward ( model, fixing, payment-fixing ) ;
final double swapAnnuity = SwapAnnuity.getSwapAnnuity(evaluationTime, fixSchedule, discountCurve, model); double floatLeg = 0; for(int periodIndex=0; periodIndex<floatSchedule.getNumberOfPeriods(); periodIndex++) { final double fixing = floatSchedule.getFixing(periodIndex); final double payment = floatSchedule.getPayment(periodIndex); final double periodLength = floatSchedule.getPeriodLength(periodIndex); <extra_id_0> final double discountFactor = discountCurve.getDiscountFactor(model, payment); floatLeg += forward * periodLength * discountFactor; } final double valueFloatLeg = floatLeg / discountCurve.getDiscountFactor(model, evaluationTime); final double swapRate = valueFloatLeg / swapAnnuity; return swapRate;