Message273759
| Author | serhiy.storchaka |
|---|---|
| Recipients | mark.dickinson, martin.panter, ned.deily, rhettinger, serhiy.storchaka, steven.daprano, tim.peters, vstinner |
| Date | 2016-08-27.05:03:25 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1472274205.89.0.0686809997068.issue27761@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
What if use pow() with exactly represented degree in approximating step?
def rootn(x, n):
g = x**(1.0/n)
m = 1 << (n-1).bit_length()
if n != m:
g = (x*g**(m-n))**(1.0/m)
return g
Maybe it needs several iterations, because it converges slower than Newton approximation. But every step can be faster. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2016-08-27 05:03:25 | serhiy.storchaka | set | recipients: + serhiy.storchaka, tim.peters, rhettinger, mark.dickinson, vstinner, ned.deily, steven.daprano, martin.panter |
| 2016-08-27 05:03:25 | serhiy.storchaka | set | messageid: <1472274205.89.0.0686809997068.issue27761@psf.upfronthosting.co.za> |
| 2016-08-27 05:03:25 | serhiy.storchaka | link | issue27761 messages |
| 2016-08-27 05:03:25 | serhiy.storchaka | create | |