Function npv_prime_r

Source
pub fn npv_prime_r<T: FloatLike>(rate: T, cash_flows: &[T]) -> T
Expand description

NPV’(r) - Derivative of the net present value with respect to the rate.

§Arguments

  • rate - The discount rate per period
  • cash_flows - A slice of cash flows, where each cash flow is at a specific period

§Returns

  • The derivative of the net present value (NPV) with respect to the rate

This function calculates the derivative of NPV.

Optimizations over summing pv_prime_r for each cash flow individually.