Anomaly watch for mpn functions

Torbjörn Granlund tg at gmplib.org
Mon Jun 12 00:57:58 UTC 2017


I wrote a little script for comparing mpn functions pairwise, and
reporting whenever their relative timing do not fall in certain
intervals.

https://gmplib.org/devel/anomaly.txt

No formatting yet, this page should move to .html at some point.

These are the current rules:

comp  add_n      sub_n       0.97 1.03
comp  addlsh1_n  rsblsh1_n   0.97 1.03
comp  addlsh2_n  rsblsh2_n   0.97 1.03
comp  addlsh_n   rsblsh_n    0.97 1.03
comp  rsh1add_n  rsh1sub_n   0.97 1.03

comp  addlsh1_n  rsh1add_n   0.90 1.10
comp  addlsh1_n  rsh1sub_n   0.90 1.10
comp  addlsh1_n  sublsh1_n   0.97 1.30
comp  addlsh2_n  sublsh2_n   0.97 1.30

comp  addlsh1_n  addlsh_n    0.97 1.40
comp  addlsh2_n  addlsh_n    0.97 1.30
comp  sublsh1_n  sublsh_n    0.97 1.40
comp  sublsh2_n  sublsh_n    0.97 1.30

comp  mul_1.3    addmul_1.3  0.97 1.2
comp  addmul_1.3 submul_1.3  0.97 1.25

comp  addlsh_n   addmul_1.3  0.97 10
comp  sublsh_n   submul_1.3  0.97 10

comp  copyi      copyd       0.90 1.10

comp  mul_basecase sqr_basecase   0.50 0.67  30
comp  mul_basecase redc_1         1.00 1.10  30
comp  mul_basecase mullo_basecase 0.50 0.67  30


The first two numbers of each line are allowed range, the optional 3rd
number is a max limb count.  When the last number is missing, 1000 is
used.

The comparisons are based on a/b where a is the geometric mean of the
timing of a series of sizes in [1,1000] for the first function, and b is
the same for the second function.

There should surely be several more rules.  Suggestions welcome.

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-devel mailing list