Certification of real inequalities: templates and sums of squares