Gröbner bases with an application to tame functions