def operate(operator, other)
      exp = operator == '/' ? -1 : 1
      if other.respond_to?(:terms)
        self.class.new(terms + other.terms.map { |t| t ** exp })
      elsif other.respond_to?(:atom)
        self.class.new(terms << other ** exp)
      elsif other.is_a?(Numeric)
        self.class.new(terms.map { |t| t.send(operator, other) })
      end
    end
def operate(operator, other)
      exp = operator == '/' ? -1 : 1
      if other.respond_to?(:terms)
        self.class.new(terms + other.terms.map { |t| t ** exp })
      elsif other.respond_to?(:atom)
        self.class.new(terms << other ** exp)
      elsif other.is_a?(Numeric)
        self.class.new(terms.map { |t| t.send(operator, other) })
      end
    end
Multiply or divide units
 @api private