[test,algorithms][util] remove ipower and its unit test
[algorithms][num_points] simplify the computation of num_points for boxes
[algorithms][num_segments] simplify the computation of num_segments for boxes