Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #80081
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.047 |
| X-Spam-Evidence | '*H*': 0.91; '*S*': 0.00; 'algorithm': 0.04; 'slow.': 0.09; 'cc:addr:python-list': 0.11; '*other*': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'inability': 0.16; 'integer.': 0.16; 'left,': 0.16; 'sat,': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'proposed': 0.22; 'cc:addr:python.org': 0.22; 'integer': 0.24; 'fine': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'shown': 0.26; 'header:In-Reply- To:1': 0.27; 'point': 0.28; 'chris': 0.29; 'message- id:@mail.gmail.com': 0.30; 'getting': 0.31; '>>>>': 0.31; 'comparison': 0.31; 'division': 0.31; 'steven': 0.31; 'trouble': 0.34; 'possible.': 0.35; 'beyond': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'done': 0.36; 'should': 0.36; 'positive': 0.37; 'christian': 0.38; 'represent': 0.38; 'e.g.': 0.38; 'nov': 0.38; 'pm,': 0.38; 'short': 0.38; 'though,': 0.39; 'enough': 0.39; 'how': 0.40; 'most': 0.60; 'first': 0.61; 'details': 0.65; 'between': 0.67; 'improvements': 0.68; 'therefore': 0.72; '09:33,': 0.84; '7:25': 0.84; 'notably,': 0.84; 'to:none': 0.92 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=4X4DLMmMws8tOQ3FnhcIBI+V1mxnSyk8Jo5zRnENiqk=; b=KsSMh9Xwhm3AqYBVOsXlH752+k5auErbqi/VPzxawrpF4ed2E3crfzg76/FmZvRGu7 fY/a71Al83sRxCXA77rAVna56WUA53mVkx8l6NLHkY9Ls3kgj8snDFLi098FjlZFbWo8 DilPujTpogQdT3t/cJr63/4moKInuLycXAkih4I/L2zSw3lj3T8LTY/CGHEeyI706N/d 82jU0yf69Q8xtYe6LfC66vQV95mt5td8MfKZJpiKWSS7jl8YKTPecwdNQdlqLunjxX1c xaOrxggKyrkki4jiboM0UCuJLeNvEufe/GhRIQUpmI7YIT4oCsV6Grnm/3VS9q7IrZ3N 4IiQ== |
| MIME-Version | 1.0 |
| X-Received | by 10.42.237.211 with SMTP id kp19mr370851icb.70.1414831545552; Sat, 01 Nov 2014 01:45:45 -0700 (PDT) |
| In-Reply-To | <m3265d$o6q$1@dont-email.me> |
| References | <54543787$0$13005$c3e8da3$5496439d@news.astraweb.com> <m3241t$ihv$1@dont-email.me> <mailman.15379.1414830070.18130.python-list@python.org> <m325dt$lsl$1@dont-email.me> <mailman.15380.1414830791.18130.python-list@python.org> <m3265d$o6q$1@dont-email.me> |
| Date | Sat, 1 Nov 2014 19:45:45 +1100 |
| Subject | Re: Challenge: optimizing isqrt |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.15381.1414831554.18130.python-list@python.org> (permalink) |
| Lines | 34 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1414831554 news.xs4all.nl 2941 [2001:888:2000:d::a6]:41325 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:80081 |
Show key headers only | View raw
On Sat, Nov 1, 2014 at 7:38 PM, Christian Gollwitzer <auriocus@gmx.de> wrote: > Am 01.11.14 09:33, schrieb Chris Angelico: >> >> On Sat, Nov 1, 2014 at 7:25 PM, Christian Gollwitzer <auriocus@gmx.de> >> wrote: >>>> >>>> Part of the point of that algorithm is that it never uses FP, and is >>>> therefore not limited by FP restrictions. >>> >>> >>> >>> which are??? >> >> >> Most notably, the inability to represent every integer beyond 2**53, >> and the inability to represent any integer beyond 2**1024. This >> algorithm should work fine with any positive integer. >> > OK so you did not bother to look at my proposed alternative implementation. > If I understood Steven correctly, he wanted to speed up the original isqrt > algorithm by using FP when this is possible. I have shown how to do it for > n<2**1022 (maybe 2**1024, I'm to lean to check it). I admit that there is > some microoptimizatio left, e.g. the first division is done twice, the > comparison should be bits>1022, not n>2*1022 etc. I did look at it. Trouble is, I don't know floating point's details well enough to prove that there are no *other* limitations. FWIW, I've proven the algorithm as far as 2**38. That's still a long way short of 2**53, though, and getting as far as 2**39 would, with my brute-force checker, require between 2.5 and 5 hours. I've made some improvements over the original, but it's still slow. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Challenge: optimizing isqrt Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-01 12:29 +1100
Re: Challenge: optimizing isqrt Chris Angelico <rosuav@gmail.com> - 2014-11-01 13:12 +1100
Re: Challenge: optimizing isqrt Christian Gollwitzer <auriocus@gmx.de> - 2014-11-01 09:02 +0100
Re: Challenge: optimizing isqrt Christian Gollwitzer <auriocus@gmx.de> - 2014-11-01 09:09 +0100
Re: Challenge: optimizing isqrt Chris Angelico <rosuav@gmail.com> - 2014-11-01 19:13 +1100
Re: Challenge: optimizing isqrt Christian Gollwitzer <auriocus@gmx.de> - 2014-11-01 09:25 +0100
Re: Challenge: optimizing isqrt Chris Angelico <rosuav@gmail.com> - 2014-11-01 19:33 +1100
Re: Challenge: optimizing isqrt Christian Gollwitzer <auriocus@gmx.de> - 2014-11-01 09:38 +0100
Re: Challenge: optimizing isqrt Chris Angelico <rosuav@gmail.com> - 2014-11-01 19:45 +1100
Re: Challenge: optimizing isqrt Akira Li <4kir4.1i@gmail.com> - 2014-11-01 12:12 +0300
Re: Challenge: optimizing isqrt Serhiy Storchaka <storchaka@gmail.com> - 2014-11-20 20:00 +0200
Re: Challenge: optimizing isqrt Stephen Tucker <stephen_tucker@sil.org> - 2014-11-21 08:15 +0000
Re: Challenge: optimizing isqrt Dave Angel <davea@davea.name> - 2014-11-23 10:43 -0500
Re: Challenge: optimizing isqrt Serhiy Storchaka <storchaka@gmail.com> - 2014-11-25 21:31 +0200
Re: Challenge: optimizing isqrt Dave Angel <davea@davea.name> - 2014-11-25 19:46 -0500
Re: Challenge: optimizing isqrt Stephen Tucker <stephen_tucker@sil.org> - 2014-11-26 07:57 +0000
Re: Challenge: optimizing isqrt Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-26 21:25 +1100
Re: Challenge: optimizing isqrt Serhiy Storchaka <storchaka@gmail.com> - 2014-11-26 18:24 +0200
csiph-web