1 votes 1 votes What does the following algorithm approximate? (Assume m>1,ϵ>0m>1,ϵ>0). x = m; y = 1; While (x-y > ϵ) { x = (x+y)/2; y = m/x; } print(x); logm m2 m1/2 m1/3 Can i get a reason of why it cannot be log m ? when finding by substituting values A_i_$_h asked Dec 15, 2017 A_i_$_h 275 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply Ashwin Kulkarni commented Dec 15, 2017 reply Follow Share put m = 6, 9, 5.... you will get values nearer to root or exact root. but far away from logm. don't only check for 4. check for 9. 0 votes 0 votes A_i_$_h commented Dec 16, 2017 reply Follow Share @ashwin but log26 and root(6) both gives 3(lower bound) only right ? 0 votes 0 votes Ashwin Kulkarni commented Dec 16, 2017 reply Follow Share Upper bounds will give 6 but there is no floor ir ceil is given and at perfect squares it calculates exact roots hence we should go with that option! 0 votes 0 votes A_i_$_h commented Dec 16, 2017 reply Follow Share @ashwin lets assume m=6 after the program is executed the value print(x) gives 3 as output now how will we determine whether to choose logm or root(m) ? 0 votes 0 votes Please log in or register to add a comment.