Updated `dict_add_term` for the case of `Number`

With this addition, A `Number` and its reciprocal both are checked
in the dict before adding it into the dict.
So effectively no cases should occur where the dict contains both
the number as well as its reciprocal
All the tests pass.