def inverse(x, operator)
      if x.num?
        x = x.to_numeric
        if operator == :+
          _(- x)
        else
          _(Rational(1, x))
        end
      elsif x.is_a?(Inverse) && x.operator == operator
        x.x
      else
        Inverse.new(x, operator)
      end
    end
def inverse(x, operator)
      if x.num?
        x = x.to_numeric
        if operator == :+
          _(- x)
        else
          _(Rational(1, x))
        end
      elsif x.is_a?(Inverse) && x.operator == operator
        x.x
      else
        Inverse.new(x, operator)
      end
    end
TODO: Cyclomatic complexity for inverse is too high. [7/6]