Relative Maximum And Minimum Test