Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: simplify and sped up
ModRat
using InverseModInt
Before (on a 64 bit machine): gap> q:=1/3;;n:=7;; for i in [1..2000000] do x:= q mod n; od; time; 258 gap> q:=1/3;;n:=2^59;; for i in [1..2000000] do x:= q mod n; od; time; 295 gap> q:=1/3;;n:=2^60;; for i in [1..2000000] do x:= q mod n; od; time; 569 gap> q:=1/3^60;;n:=7;; for i in [1..2000000] do x:= q mod n; od; time; 537 gap> q:=1/3^60;;n:=2^59;; for i in [1..2000000] do x:= q mod n; od; time; 2364 gap> q:=1/3^60;;n:=2^60;; for i in [1..2000000] do x:= q mod n; od; time; 2821 gap> q:=1/2^6000;;n:=3^6000;; for i in [1..6000] do x:= (q mod n); od; time; 19358 After: gap> q:=1/3;;n:=7;; for i in [1..2000000] do x:= q mod n; od; time; 255 gap> q:=1/3;;n:=2^59;; for i in [1..2000000] do x:= q mod n; od; time; 244 gap> q:=1/3;;n:=2^60;; for i in [1..2000000] do x:= q mod n; od; time; 392 gap> q:=1/3^60;;n:=7;; for i in [1..2000000] do x:= q mod n; od; time; 245 gap> q:=1/3^60;;n:=2^59;; for i in [1..2000000] do x:= q mod n; od; time; 1219 gap> q:=1/3^60;;n:=2^60;; for i in [1..2000000] do x:= q mod n; od; time; 1292 gap> q:=1/2^6000;;n:=3^6000;; for i in [1..6000] do x:= (q mod n); od; time; 692
- Loading branch information