synthetic division for evaluating functions