lib/benchmark/trend.rb
def fit_at(type, slope: nil, intercept: nil, n: nil)
      raise ArgumentError, "Incorrect input size: #{n}" unless n > 0

      case type
      when :logarithmic, :log
        intercept + slope * Math.log(n)
      when :linear
        intercept + slope * n
      when :power
        intercept * (n ** slope)
      when :exponential, :exp
        intercept * (slope ** n)
      else
        raise ArgumentError, "Unknown fit type: #{type}"
      end
    end
def fit_at(type, slope: nil, intercept: nil, n: nil)
      raise ArgumentError, "Incorrect input size: #{n}" unless n > 0

      case type
      when :logarithmic, :log
        intercept + slope * Math.log(n)
      when :linear
        intercept + slope * n
      when :power
        intercept * (n ** slope)
      when :exponential, :exp
        intercept * (slope ** n)
      else
        raise ArgumentError, "Unknown fit type: #{type}"
      end
    end
Take a fit and estimate behaviour at input size n

 @example
   fit_at(:power, slope: 1.5, intercept: 2, n: 10)

 @return
   fit model value for input n

 @api public