Find Minimum And Maximum Values Of A Function