This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients mark.dickinson, martin.panter, ned.deily, rhettinger, serhiy.storchaka, steven.daprano, tim.peters, vstinner
Date 2016-08-28.17:49:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1472406584.58.0.822285355809.issue27761@psf.upfronthosting.co.za>
In-reply-to
Content
That's clever, Serhiy!  Where did it come from?  It's not Newton's method, but it also appears to enjoy quadratic convergence.

As to speed, why are you asking?  You should be able to time it, yes?  On my box, it's about 6 times slower than the last code I posted.  I assume (but don't know) that's because + - * / have trivial cost compared to power() and ln(), and your code uses two ln() while the last code I posted uses only one power().  Also, my power() has an exact integer exponent, which - for whatever reasons - appears to run much faster than using a non-integer Decimal exponent.  It's for the latter reason that I didn't suggest just doing `return float(D(x) ** (D(1)/n))` (much slower).

Or maybe it's "a platform thing".  FYI, I'm using the released Python 3.5.2 on 64-bit Win 10 Pro.
History
Date User Action Args
2016-08-28 17:49:44tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, vstinner, ned.deily, steven.daprano, martin.panter, serhiy.storchaka
2016-08-28 17:49:44tim.peterssetmessageid: <1472406584.58.0.822285355809.issue27761@psf.upfronthosting.co.za>
2016-08-28 17:49:44tim.peterslinkissue27761 messages
2016-08-28 17:49:44tim.peterscreate