On 23 sep, 06:57, "D. S. McNeil" <dsm...@gmail.com> wrote:
> I think replacing 2/3 with 2./3 in
>
>                 if abs(varia-root)<2/3:
>
> will help a little.. :^)  By itself, that cuts the time down to 19s for me.

Slightly better, save yourself doing the same computation over and
over inside all the loops

    if abs(varia-root) < 0.67

it is a very little time but adds up quickly over the iterations. Or
if you want to be finer, define the 2./3 as a constant outside of the
loops (with whichever precision you need) and then use the defined
constant inside.

Cheers
Javier

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to