def xirr(midpoint, options)

      # Initial values
      left  = [BigDecimal.new(-0.99999999, Xirr::PRECISION), cf.irr_guess].min
      right = [BigDecimal.new(9.99999999, Xirr::PRECISION), cf.irr_guess + 1].max
      @original_right = right
      midpoint ||= cf.irr_guess

      midpoint, runs = loop_rates(left, midpoint, right, options[:iteration_limit])

      get_answer(midpoint, options, runs)

    end
def xirr(midpoint, options)

      # Initial values
      left  = [BigDecimal.new(-0.99999999, Xirr::PRECISION), cf.irr_guess].min
      right = [BigDecimal.new(9.99999999, Xirr::PRECISION), cf.irr_guess + 1].max
      @original_right = right
      midpoint ||= cf.irr_guess

      midpoint, runs = loop_rates(left, midpoint, right, options[:iteration_limit])

      get_answer(midpoint, options, runs)

    end
Calculates yearly Internal Rate of Return
 @return [BigDecimal]
 @param midpoint [Float]
 An initial guess rate will override the {Cashflow#irr_guess}