Division and conquest method for calculating roots

Knowing that we can use the Divide-and-Conquer algorithm to calculate larger metrics, for example 2 exp 100 = 2 exp(50) * 2 exp(50)

, which is more efficient, is this method efficient using roots? For example 2 exp (1/100) = (2 exp(1/50)) exp(1/50)

?

In other words, I wonder whether the more effective (n exp(1/x))

for the (n exp(1/y))

for x < y

and where x and y - integers.

+2


source to share


2 answers


As a x,y

floating point number exp(1/x)

may be no more efficient than it is exp(1/y)

for everyone x<y

.

But the algorithms of separation and conquest are that

if we have something like exp(1/x)

, we will not calculate it again, i.e. split 2^N

into two identical smaller problems 2^(N/2) * 2^(N/2)

, and we 2^(N/2)

only compute once .



Similarly, for exp(2/x)

can be divided by exp(1/x)*exp(1/x)

, and we exp(1/x)

only have to calculate once. This should improve performance.

Also have a lower denominator.

So I think this should work fine.

0


source


I don't think divide and conquer method is used when you have non-integer exponents. I would assume that the Taylor polynomial is used to calculate x ^ y for e ^ (y ln (x)). You can calculate the integer part of y using divide and conquer, then multiply it by the real part. But it doesn't make sense to split it into two parts. Also:

2 exp (1/100) = (2 exp (1/50)) exp (1/50)

This is not true.



(2 exp (1/50)) exp (1/50) = 2 exp (1/50 + 1/50) = 2 * exp (1/25)! = 2 exp (1/100)

You will be doing:

2 exp (1/100) = 2 * exp (1/200) * exp (1/200)

+1


source







All Articles