23 February 2020 01:34:35 PM
CYCLE_BRENT_TEST
C++ version
Test the CYCLE_BRENT library.
TEST01
Test CYCLE_BRENT on F1().
f1(0) = 6.
f1(1) = 6.
f1(2) = 0.
f1(3) = 1.
f1(4) = 4.
f1(5) = 3.
f1(6) = 3.
f1(7) = 4.
f1(8) = 0.
Starting argument X0 = 2
Reported cycle length is 3
Expected value is 3
Reported distance to first cycle element is 2
Expected value is 2
TEST02
Test CYCLE_BRENT for F2().
f2(i) = mod ( 22 * i + 1, 72 ).
Starting argument X0 = 0
Reported cycle length is 9
Expected value is 9
Reported distance to first cycle element is 3
Expected value is 3
TEST03
Test CYCLE_BRENT for F3().
f3(i) = mod ( 123 * i + 456, 100000 ).
Starting argument X0 = 789
Reported cycle length is 50000
Expected value is 50000
Reported distance to first cycle element is 0
Expected value is 0
TEST04
Test CYCLE_BRENT for F4().
f4(i) = mod ( 31421 * i + 6927, 65536 ).
Starting argument X0 = 1
Reported cycle length is 65536
Expected value is 65536
Reported distance to first cycle element is 0
Expected value is 0
TEST05
Test CYCLE_BRENT for F5().
f5(i) = mod ( 16383 * i + 1, 65536 ).
Starting argument X0 = 1
Reported cycle length is 8
Expected value is 8
Reported distance to first cycle element is 0
Expected value is 0
0 1
1 16384
2 49153
3 32768
4 32769
5 49152
6 16385
7 0
8 1
9 16384
10 49153
CYCLE_BRENT_TEST
Normal end of execution.
23 February 2020 01:34:35 PM