Optimisation in farey()

Substituted multiplication for division in farey which led to 30%
increase in speed in set_frequency()