# Revision history [back]

It seems to work for me:

sage: load "exp.spyx"
Compiling exp.spyx...
sage: time pollard_rho(next_prime(10**6)*previous_prime(10**7))
CPU times: user 0.23 s, sys: 0.01 s, total: 0.23 s
Wall time: 0.24 s
1000003


I'm a little puzzled, though, because the error message you show doesn't seem to correspond to the line in your source, namely that in the code you put up it says "sage.all.mod(sage.all.mod(y,n)**2+1,n)**2+1" but the error message points to a line of code reading 2+1,n)**2+1", but the error message is pointing to y = sage.all.mod(sage.mod(y,n)**2+1,n)**2+1, without an ".all." between sage and mod, so it seems to be looking in the module "sage" for the function mod.

For what it's worth, that's exactly the error message I get if I remove the ".all".

It seems to work for me:

sage: load "exp.spyx"
Compiling exp.spyx...
sage: time pollard_rho(next_prime(10**6)*previous_prime(10**7))
CPU times: user 0.23 s, sys: 0.01 s, total: 0.23 s
Wall time: 0.24 s
1000003


I'm a little puzzled, though, because the error message you show doesn't seem to correspond to the line in your source, namely that in the code you put up it says "sage.all.mod(sage.all.mod(y,n)**2+1,n)**2+1" but the error message points to a line of code reading 2+1,n)**2+1", but the error message is pointing to "y = sage.all.mod(sage.mod(y,n)**2+1,n)**2+1, ", without an ".all." between sage and mod, so it seems to be looking in the module "sage" for the function mod.

For what it's worth, that's exactly the error message I get if I remove the ".all".