from math import * def ln(x,p): n=0 while(abs(x-1)>10**(-p)): n+=1 x=sqrt(x) y=x-1 while(n>0): y=y*2 n=n-1 return y