The primary reason that leasing generally yields lower monthly payments is that although you are still paying the interest based on the full
amount of the loan, the capital parts of the payments only have to add up to the difference between the loan and the Residual Value.
The following formula calculates the monthly payment and can be reduced to the Advanced Loan Calculator
formula when F = 0.

For given C, P and N, one can only solve the following equation for r by numerical means.
Given the rather smooth behavior of this equation, this calculator employs the Newton-Raphson method with an educated initial guess: