attempt to fix issue 3479 with min() and test cases
Merge branch 'issue3479_trial2' of https://github.com/bgee/sympy into issue3479_trial2