logarithm - Is there any faster algorithm to find approx value of log(n) and what will be time complexity of that? -


is there faster algorithm find approx value of log(n) , time complexity of ?

i want approx integer value of log(n) , inbuilt function log(n) in java gives ans approximate accuracy in double useless me , take time. since log , multiplication 1 of primary function in program , log make program slow.

here benchmark

multiply took: 466 milliseconds

logarithm took: 3245 milliseconds

it's approximate 10 time of multiplication.

(note:-here used benchmark show took time compare other primary function of program , know not possible compare 2 different type of function)

so want know there faster algorithm find approx value of log(n) , time complexity of ?

(note :- algorithm should work log() base)

i have no idea if faster, assuming have integer x , want log in base k:

log_k(x) = log_2(x)/log_2(k) 

note i, floor(log_2(i)) 'index' of significant none 0 bit


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -