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 steven.daprano
Recipients mark.dickinson, martin.panter, ned.deily, rhettinger, serhiy.storchaka, steven.daprano, tim.peters, vstinner
Date 2016-08-28.16:08:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20160828160810.GX26300@ando.pearwood.info>
In-reply-to <1472398954.58.0.0945750122141.issue27761@psf.upfronthosting.co.za>
Content
This has been really eye-opening, and I just wanted to drop you a note 
that I am watching this thread carefully. My first priority is to get 
the tests all passing before beta 1 on 2016-09-12, even if (as seems 
likely) that means weakening the tests, and then come back and see if we 
can tighten it up again later.

I haven't checked it in yet, but I've already managed to simplify the 
nth_root code by taking Tim's advice that more than one iteration of 
Newton's method is a waste of time. Thanks!

Can somebody comment on my reasoning here?

I start by taking an initial guess for the root by using 
r = pow(x, 1.0/n). Then I test if r**n == x, if it does I conclude that 
r is either the exact root, or as close as representable as a float, and 
just return it without bothering with even one iteration. Sensible?

Or should I just always run one iteration of Newton and trust that it 
won't make things worse?
History
Date User Action Args
2016-08-28 16:08:16steven.dapranosetrecipients: + steven.daprano, tim.peters, rhettinger, mark.dickinson, vstinner, ned.deily, martin.panter, serhiy.storchaka
2016-08-28 16:08:16steven.dapranolinkissue27761 messages
2016-08-28 16:08:15steven.dapranocreate