Skip to content

Commit a3a3c7e

Browse files
committed
new release 1.4.0
1 parent 046d987 commit a3a3c7e

File tree

3 files changed

+68
-23
lines changed

3 files changed

+68
-23
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ Other noteworthy parts of this library are
3232

3333
## Releases
3434

35+
* v1.4.0 was mainly a quality assurance initiative: Upgrade log4j to version 2, convert the project to Maven structure, set up a CI in github, and convert main() method tests into JUnit tests. Next, it fixes two more bugs resulting from the poor initial integration of TinyEcm64, leading to CombinedFactorAlgorithm.factor() to omit factors of some composites having 46 to 62 bit and several small factors including at least one square, or CombinedFactorAlgorithm.findSingleFactor() to fail termination for some numbers of the same characteristics. Last not least, the performance of all PollardRho- and TinyEcm64-variants has been improved considerably.
3536
* v1.3.1: Fixed two bugs that may lead to factoring failures when trying to factor arguments in the range 32..62 bit using class CombinedFactorAlgorithm.
3637
These bugs were introduced 2021-07-12 shortly after release 1.1, so they affect release 1.2 and 1.3.
3738
* v1.3: Implemented Gaussian integer and quaternion arithmetics including gcd's, and a four-square finder using them.
3839
* v1.2: Implemented SIQS with three large primes (but with the current parametrization, 3-partials are not found for N<=400 bit)
3940
* v1.1: Faster sieve for large N, speedup close to factor 2 at 360 bit inputs. Improved Gaussian solvers (by Dave McGuigan), including a parallel Gaussian solver that outperforms Block-Lanczos until about 375 bit on a Ryzen 3900X with 20 threads.
40-
From now on, <strong>Java 10</strong> is required!
41+
From now on, Java 9 is required!
4142
* v1.0: Integrated and adjusted Dario Alpern's ECM in class CombinedFactorAlgorithm.
4243
* v0.9.11: Added SSOZJ, a fast twin prime sieve; guard analysis code by final static booleans, so that the code is removed by the compiler when the boolean is set to false.
4344
* v0.9.10: Added port of Ben Buhrow's tinyecm.c.
@@ -74,16 +75,20 @@ The amount of analysis and logging can be influenced by setting the static varia
7475
Note that for factoring very large numbers with multi-threaded algorithms like PSIQS, PSIQS_U, CombinedFactorAlgorithm or BatchFactorizer, the number of threads should not exceed the number of physical cores of your computer. The number size bound where this effect sets in seems to depend mostly on the L3 cache of your computer. The cause is explained well in [SMT disadvantages](https://en.wikipedia.org/wiki/Simultaneous_multithreading#Disadvantages).
7576

7677

77-
## Factoring records
78+
## Factoring performance
7879

79-
My current factoring record is the 400 bit (121 decimal digits) hard semiprime
80+
Here is an actual performance comparison of [jml 1.4.0 CombinedFactorAlgorithm vs. Yafu](doc/PSIQS-performance.txt). They seem to be more or less on the same level now.
81+
82+
jml's current factoring record is the 400 bit (121 decimal digits) hard semiprime
8083
<code>
8184
1830579336380661228946399959861611337905178485105549386694491711628042180605636192081652243693741094118383699736168785617
8285
= 785506617513464525087105385677215644061830019071786760495463 * 2330444194315502255622868487811486748081284934379686652689159
8386
</code><br />
8487

8588
Its factorization took less than 22 hours on a Ryzen 9 3900X with 12 sieve threads using jml 1.1. See [factoring report on mersenneforum.org](https://www.mersenneforum.org/showthread.php?p=583868#post583868).
8689

90+
Actually it should be easy to beat that. I didn't try that number or anything bigger again.
91+
8792

8893
## Authors
8994

@@ -102,7 +107,7 @@ Big thanks to
102107
* Graeme Willoughby for his great comments on the BigInteger algorithms in the SqrtInt, SqrtExact, Root and PurePowerTest classes
103108
* Thilo Harich for a great collaboration and his immense improvements on the Lehman factoring method
104109
* Ben Buhrow for his free, open source [tinyecm.c](https://www.mersenneforum.org/showpost.php?p=521028&postcount=84) and his comments on mersenneforum.org that helped a lot to improve the performance of my Java port
105-
* Dave McGuigan, who contributed a parallel Gaussian solver and even sped up my single-threaded Gaussian solver by a remarkable factor
110+
* Dave McGuigan, who contributed a parallel Gaussian solver, even sped up my single-threaded Gaussian solver by a remarkable factor, and helped to improve some of my PollardRho implementations
106111

107112
Some (other) third-party software reused in this library:
108113
* [Dario Alpern's ECM implementation](https://github.com/alpertron/calculators/blob/master/OldApplets/ecm.java),

doc/PSIQS-performance.txt

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,65 @@
1-
Performance comparison of Dario Alpern's SIQS, PSIQS and Yafu 1.34.5 Win64
2-
==========================================================================
3-
4-
Test platform: i7-2630QM notebook with 16 GB RAM, no SSD, Windows 10 (64 bit).
5-
Java programs were compiled to bytecode with Eclipse 4.7.2, run with Oracle JDK8u112.
6-
All programs were run with 6 threads.
1+
Performance comparison of PSIQS and Yafu
2+
========================================
73

84
Test numbers:
95

10-
250 bit (c75): 966983290915691193309978723256242679920691599725908954700676674631843021151, factor 2166660942804222727904664493239497749 (121 bits)
11-
260 bit (c79): 1405841556925214879486442303149405905001665390832024207523131521166180858938813, factor 67442061758209470276693046261 (96 bits)
12-
270 bit (c82): 1862250708148641942690960669479655453558455211114669315970990094883431140413691063, factor 10131012562771734141422710036441 (103 bits)
13-
280 bit (c85): 1124255513875297636309545520595967278216022444499041658628707408527781223819691431297, factor 102215939439709564867375590146800830467 (127 bits)
14-
290 bit (c88): 1714638254587752572163813097700639375461962331568828069462681800410360936140704797782927, factor 118213006591252560634534512340187 (106 bits)
15-
300 bit (c91): 1420645858748273907814607735289301772937523982503611315908309844444825252076415096683379639, factor 37001601928978936147228977127981 (105 bits)
16-
310 bit (c94): 1504728267636063453737937497689480949465080318766121587410405654071410646640268764306438447777, factor 78826750148916873060910019453093 (106 bits)
17-
320 bit (c97): 1520485323412100005395027120737880529234221500427246782721628759918241045629822884369979557002797, factor 26708589799276429676372119945486621441898621 (144 bits)
18-
330 bit (c100): 1480043784220046663418677695827289686591546373143422996772942819804186784116179599537527918653095289, factor 62125133246163719560488825370539230413837849 (146 bits)
19-
339 bit (c103): 1049318608354150719312497493537522807450843398013344125038634265072726507929273547596187217203526415417, factor 2254125207506194947465713574724871004145473711091193254616100967 (211 bits)
6+
250 bit (c75): 966983290915691193309978723256242679920691599725908954700676674631843021151, factor 2166660942804222727904664493239497749 (121 bit)
7+
260 bit (c79): 1405841556925214879486442303149405905001665390832024207523131521166180858938813, factor 67442061758209470276693046261 (96 bit)
8+
270 bit (c82): 1862250708148641942690960669479655453558455211114669315970990094883431140413691063, factor 10131012562771734141422710036441 (103 bit)
9+
280 bit (c85): 1124255513875297636309545520595967278216022444499041658628707408527781223819691431297, factor 102215939439709564867375590146800830467 (127 bit)
10+
290 bit (c88): 1714638254587752572163813097700639375461962331568828069462681800410360936140704797782927, factor 118213006591252560634534512340187 (106 bit)
11+
300 bit (c91): 1420645858748273907814607735289301772937523982503611315908309844444825252076415096683379639, factor 37001601928978936147228977127981 (105 bit)
12+
310 bit (c94): 1504728267636063453737937497689480949465080318766121587410405654071410646640268764306438447777, factor 78826750148916873060910019453093 (106 bit)
13+
320 bit (c97): 1520485323412100005395027120737880529234221500427246782721628759918241045629822884369979557002797, factor 26708589799276429676372119945486621441898621 (144 bit)
14+
330 bit (c100): 1480043784220046663418677695827289686591546373143422996772942819804186784116179599537527918653095289, factor 62125133246163719560488825370539230413837849 (146 bit)
15+
339 bit (c103): 1049318608354150719312497493537522807450843398013344125038634265072726507929273547596187217203526415417, factor 465510347366658827076629887957613728351 (129 bit)
16+
350 bit (c106): 1344601101078147834667088194322760918459476360776521130149769671940053166330038635808404527507420138954493, factor 331686138946723321935635809590113258389 (128 bit)
17+
360 bit (c109): 1715044901661741756691187538339970282118803131687211920216367244483097879960038708679003124090476091871588477, factor 678380515538187414188196795567090663079997 (139 bit)
18+
19+
20+
21+
2025 comparison -------------------------------------------------------------------------------------
22+
23+
Test platform: AMD Ryzen 3900X with 32 GB RAM, SSD, Windows 10 (64 bit).
24+
25+
Candidates:
26+
* jml-1.4.0 is https://github.com/TilmanNeumann/java-math-library/blob/master/src/main/java/de/tilman_neumann/jml/factor/CombinedFactorAlgorithmRunner.java,
27+
compiled to bytecode and run with graalvm-jdk-23.0.1+11.1 (compiler compliance level 10).
28+
it is running some Ecm, too, which makes no sense for these numbers, but the overhead should be small.
29+
* Yafu 1.34.5 is yafu-x64.exe from https://sourceforge.net/projects/yafu/files/
30+
* YaFu 2.11 is yafu-x64-avx2.exe (because my CPU does not support AVX512) from https://github.com/bbuhrow/yafu
31+
32+
All programs were run with 12 threads.
33+
34+
Results in seconds:
2035

21-
The last number was supposed to have 340 bit, but sometimes my test number generator falls 1 bit short.
36+
Bits jml-1.4.0 (factor) Yafu 1.34.5 (factor) Yafu 2.11 (factor)
37+
38+
250 7.3 1.177 6.2 1.0 5.2 0.838
39+
260 9.9 1.088 9.1 1.0 7.7 0.846
40+
270 18.5 1.107 16.7 1.0 14.9 0.892
41+
280 28.1 1.076 26.1 1.0 23.1 0.885
42+
290 53.9 0.927 58.1 1.0 48.3 0.831
43+
300 94.3 0.907 104.0 1.0 81.6 0.784
44+
310 169.7 0.845 200.8 1.0 147.8 0.736
45+
320 279.4 0.854 327.2 1.0 260.7 0.796
46+
330 557.2 0.823 677.1 1.0 544.6 0.804
47+
339 984.8 0.819 1201.5 1.0 995.2 0.828
48+
350 1565.2 0.837 1868.8 1.0 1666.8 0.892
49+
360 3251.4 0.874 3718.6 1.0 3519.2 0.946
50+
51+
52+
53+
2018 comparison (including Dario Alpern's SIQS) ------------------------------------------------------
54+
55+
Test platform: i7-2630QM notebook with 16 GB RAM, no SSD, Windows 10 (64 bit).
56+
57+
Java programs were compiled to bytecode with Eclipse 4.7.2, run with Oracle JDK8u112.
58+
Yafu 1.34.5 is yafu-x64.exe from https://sourceforge.net/projects/yafu/files/
59+
60+
All programs were run with 6 threads.
2261

23-
Results:
62+
Results in seconds:
2463

2564
Bits Alpern (factor) PSIQS2.1 (factor) PSIQS4.0 (factor) Yafu 1.34.5 (factor)
2665

@@ -35,4 +74,5 @@ Bits Alpern (factor) PSIQS2.1 (factor) PSIQS4.0 (factor) Yafu 1.34
3574
330 - - 12460.7 3.17 8669.0 2.21 3918.9 1.0
3675
339 - - - - 16669.1 2.48 6714.5 1.0
3776

77+
See also https://www.mersenneforum.org/node/15398?p=651308#post651308
3878

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<name>Java Math Library (JML)</name>
1010
<groupId>de.tilman_neumann</groupId>
1111
<artifactId>jml</artifactId>
12-
<version>1.4.0-beta</version>
12+
<version>1.4.0</version>
1313
<packaging>jar</packaging>
1414
<description>My general math library, containing pretty fast factoring algorithms (except NFS), partition generators and more.</description>
1515
<url>https://github.com/TilmanNeumann/java-math-library</url>

0 commit comments

Comments
 (0)