make approx_sum user define function;