Skip to content

Conversation

@czurnieden
Copy link
Contributor

@czurnieden czurnieden commented Oct 10, 2019

This is the version with a large error range -0,+x (with x < 28,328)
PR slicing as asked for in #343
EDIT: corrected sign for thousands separator.

@czurnieden
Copy link
Contributor Author

With an additional 8 bit precision for the cost of a 65 bytes large table plus alignment, one bigint, one mp_set, one big-shift, and one big-add (the difference in run-time is negligible), we get the following max. errors:

bits       base max    target      actual
1           2   4    1           5
2139520001  3   117  1349886827  1349886944
1           4   3    1           4
2139220001  5   32   921311907   921311939
2115820001  6   46   818510907   818510953
2138500001  7   132  761749070   761749202
20001       8   4    6667        6671
2120430001  9   60   668921189   668921249
2037150001  10  17   613243256   613243273
2141240001  11  84   618957169   618957253
2132130001  12  26   594742623   594742649
2119170001  13  45   572680590   572680635
2120090001  14  73   556840653   556840726
2102510001  15  32   538154307   538154339
1           16  3    1           4
2129130001  17  57   520892809   520892866
2097270001  18  36   502951492   502951528
2113540001  19  42   497546155   497546197
2118170001  20  12   490098390   490098402
2115310001  21  18   481593154   481593172
2135070001  22  52   478776262   478776314
23000001    23  4    5084489     5084493
2060300001  24  17   449360273   449360290
2139860001  25  18   460793770   460793788
2085350001  26  29   443649983   443650012
2102650001  27  41   442208149   442208190
2107170001  28  47   438322120   438322167
2123010001  29  28   437014884   437014912
2132930001  30  22   434680570   434680592
2131230001  31  33   430186829   430186862
1           32  3    1           4
1976180001  33  12   391757653   391757665
2116600001  34  38   416042351   416042389
2008370001  35  9    391549851   391549860
2116710001  36  25   409427603   409427628
2090630001  37  24   401314659   401314683
2123160001  38  29   404571137   404571166
2107840001  39  34   398804086   398804120
2007340001  40  9    377182849   377182858
2136790001  41  36   398837006   398837042
2050710001  42  13   380302167   380302180
2136250001  43  38   393687020   393687058
2132980001  44  36   390696349   390696385
2065550001  45  27   376111663   376111690
36360001    46  4    6582709     6582713
1625830001  47  7    292700332   292700339
2118210001  48  13   379270228   379270241
2094530001  49  35   373043320   373043355
2032970001  50  13   360209391   360209404
1791720001  51  8    315864889   315864897
2085050001  52  21   365770029   365770050
2138400001  53  30   373329207   373329237
2080010001  54  29   361433651   361433680
1633550001  55  6    282554638   282554644
2146240001  56  34   369572728   369572762
2084270001  57  32   357330585   357330617
2057900001  58  20   351298511   351298531
2054480001  59  22   349244376   349244398
2059810001  60  16   348713078   348713094
2095540001  61  23   353335493   353335516
2123330001  62  24   356610681   356610705
2062520001  63  19   345059965   345059984
1           64  3    1           4

Not 100% tested yet, only every 10.000th value checked to find a highly likely maximum for decision making.

@minad minad added this to the v2.0.0 milestone Oct 14, 2019
@czurnieden czurnieden force-pushed the radix_approximate branch 3 times, most recently from 89ed034 to 31fbb95 Compare October 15, 2019 19:12
@czurnieden czurnieden force-pushed the radix_approximate branch 2 times, most recently from 1e1315f to 8fef549 Compare October 19, 2019 18:48
@minad
Copy link
Member

minad commented Oct 22, 2019

What is the maximal error? 28? Then this version looks pretty good.

@czurnieden
Copy link
Contributor Author

What is the maximal error? 28?

No, not 28, it is a bit more: twenty eight thousand three hundred and twenty eight.
*passes reading glasses* ;-)

With the extra 8 bit precision it is probably lower than ~200 digits (no full test run done yet).

@minad
Copy link
Member

minad commented Oct 22, 2019

The dot confused me. But we are talking integers so :P.

This is out of question then.

@minad minad changed the title Minimal version of bn_mp_radix_size_overestimate Minimal mp_radix_size_overestimate, very large error Oct 22, 2019
@minad
Copy link
Member

minad commented Oct 22, 2019

@czurnieden since we both agree on #371, I think it is ok to close this.

@minad minad closed this Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants