Java is a faster alternative to Math.pow () and Math.sqrt ()

My program uses Math.pow()to calculate a relatively large double number in power 2. Later I need to find the square root of a very large double number. The problem is that I have to do this more than 100,000 times, and it takes a very long time. Is there an alternative that can speed up this process? Thanks

Edit: by large numbers, I mean from 1,000 to 10,000 (which is probably not so great in computational terms). And from the point of view of this, it takes a lot of time, it takes about 30 seconds to perform the function 500 times

+5
source share
5 answers

( ) , Java Math. , . , ?

, , (- Matlab).

. , , .

+7

" 2" . , .

sqrt, , , , . C, . , ? , .. ? , HashMap , .

+8

, 2 . , , a - , 2. , : int a=5; int b=a*a;

+1

, , , , ~ 9000 . , , .

+1

x * x pow (x, 2).

sqrt ( ).

, , ( sqrt (N) -x = 0).

, .

, .

0

All Articles