def xirr guess, options
      func = Function.new(self, :xnpv)
      rate = [guess || cf.irr_guess]
      begin
        nlsolve(func, rate)
        (rate[0] <= -1 || rate[0].nan?) ? nil : rate[0].round(Xirr::PRECISION)

          # rate[0].round(Xirr::PRECISION)
      rescue
        nil
      end
    end
def xirr guess, options
      func = Function.new(self, :xnpv)
      rate = [guess || cf.irr_guess]
      begin
        nlsolve(func, rate)
        (rate[0] <= -1 || rate[0].nan?) ? nil : rate[0].round(Xirr::PRECISION)

          # rate[0].round(Xirr::PRECISION)
      rescue
        nil
      end
    end
Calculates XIRR using Newton method
 @return [BigDecimal]
 @param guess [Float]