Issue 219 in mpmath: giant_steps

0 views
Skip to first unread message

mpm...@googlecode.com

unread,
Feb 21, 2012, 10:52:25 PM2/21/12
to mpmath...@googlegroups.com
Status: New
Owner: ----

New issue 219 by smi...@gmail.com: giant_steps
http://code.google.com/p/mpmath/issues/detail?id=219

What steps will reproduce the problem?
1. giant_steps(1, 100)

What is the expected output?

[4, 5, 7, 10, 16, 28, 52, 100]

What do you see instead?

hangs

What version of the product are you using? On what operating system?
0.17

Please provide any additional information below.

The following may be a more robust code for that routine:

L = [target]
while 1:
Li = L[-1]//n + 2
if Li >= L[-1]:
break
L.append(Li)
return L[::-1]


mpm...@googlecode.com

unread,
Feb 21, 2012, 11:01:29 PM2/21/12
to mpmath...@googlegroups.com

Comment #1 on issue 219 by smi...@gmail.com: giant_steps
http://code.google.com/p/mpmath/issues/detail?id=219

I guess `if Li >= L[-1] or Li < start` would be better for the break
condition.

mpm...@googlecode.com

unread,
Feb 23, 2012, 11:04:30 AM2/23/12
to mpmath...@googlegroups.com

Comment #2 on issue 219 by fredrik....@gmail.com: giant_steps
http://code.google.com/p/mpmath/issues/detail?id=219

I don't see much need to change this function, as it's really only intended
internally for numerical Newton iteration where the starting precision is
much higher than 1.

For algebraic Newton iteration, where the starting precision might be 1, it
is better to use a more exact version, precisely doing ceiling divisions by
n.

The proposed change would not really be correct anyway as it should start
with something like 1, 2, 3, ...


mpm...@googlecode.com

unread,
Feb 23, 2012, 1:43:31 PM2/23/12
to mpmath...@googlegroups.com

Comment #3 on issue 219 by smi...@gmail.com: giant_steps
http://code.google.com/p/mpmath/issues/detail?id=219

OK. And it only hangs if you happen to start at 1. Since it wasn't a
private function it caught my attention.

Reply all
Reply to author
Forward
0 new messages