Fast Distributed algorithms for computing separable functions