-
Notifications
You must be signed in to change notification settings - Fork 160
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
Showing
3 changed files
with
39 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters