From 9e1d4ee6d4597a1f47b612168e7002b78cb3400a Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sun, 23 Jul 2023 12:47:47 +0200 Subject: [PATCH] move to xorshift64. Better precision. --- README.md | 6 ++-- examples/01_one_sample/example | Bin 22248 -> 22288 bytes examples/01_one_sample/example.c | 12 +++---- examples/02_many_samples/example | Bin 22288 -> 22328 bytes examples/02_many_samples/example.c | 12 +++---- examples/03_gcc_nested_function/example | Bin 22312 -> 22344 bytes examples/03_gcc_nested_function/example.c | 12 +++---- examples/04_sample_from_cdf_simple/example | Bin 22400 -> 22432 bytes examples/04_sample_from_cdf_simple/example.c | 4 +-- examples/05_sample_from_cdf_beta/example | Bin 22424 -> 26552 bytes examples/05_sample_from_cdf_beta/example.c | 4 +-- examples/06_gamma_beta/example | Bin 22160 -> 22192 bytes examples/06_gamma_beta/example.c | 2 +- squiggle.c | 34 +++++++++---------- squiggle.h | 26 +++++++------- test/test | Bin 22272 -> 22312 bytes test/test.c | 8 ++--- 17 files changed, 60 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 658ac0a..4185179 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ In squiggle.c, this ambiguity doesn't exist, at the cost of much greater overhea int main(){ // set randomness seed - uint32_t* seed = malloc(sizeof(uint32_t)); + uint64_t* seed = malloc(sizeof(uint64_t)); *seed = 1000; // xorshift can't start with a seed of 0 float a = sample_to(1, 10, seed); @@ -153,7 +153,7 @@ vs #include #include -float draw_xyz(uint32_t* seed){ +float draw_xyz(uint64_t* seed){ // function could also be placed inside main with gcc nested functions extension. return sample_to(1, 20, seed); } @@ -161,7 +161,7 @@ float draw_xyz(uint32_t* seed){ int main(){ // set randomness seed - uint32_t* seed = malloc(sizeof(uint32_t)); + uint64_t* seed = malloc(sizeof(uint64_t)); *seed = 1000; // xorshift can't start with a seed of 0 float a = draw_xyz(seed); diff --git a/examples/01_one_sample/example b/examples/01_one_sample/example index ce809912ade8a722fce2fa955e309b83327ba04b..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=!9yvMAgDxAEd%@d^LRvw&GLO;JD9kh3 zLc)2t?j(!TfS&~OIaD_pMWE;!h55$fkhOxk$2m#Zgqho@TZlmM>B~vjzYaw&!(7b< zbgokrDgo%w1pC2%llT}ER5GwxS&}RlD3A)~0$c;EO~WV}YBkd!d%7S#vK~`An#s*t z3Nq5S!RJ{{W3JQaC^6bfjFu9ksl=!&pOg!!BiQP=&ORx~4j;gD?{yYcm>*8vSMen) zDSR@22TjpvGc;59f5PntM$H$*h*gT`IPe2E+4;f}-593b*uriV$M}n9>LOTW z4AxVg>8z*fU<7l#8>t|zKCK_!SkpM5;R93Ebua;~q&~4re#t`|Xk`QsPKt&f&>{+UhyyrT zF@48Mfwq6^6jjev6BHL-rO{`bFw0 JiRCS^{u?8#sJH+C diff --git a/examples/01_one_sample/example.c b/examples/01_one_sample/example.c index 4badc5e..f1687ae 100644 --- a/examples/01_one_sample/example.c +++ b/examples/01_one_sample/example.c @@ -4,29 +4,29 @@ #include // Estimate functions -float sample_0(uint32_t* seed) +float sample_0(uint64_t* seed) { return 0; } -float sample_1(uint32_t* seed) +float sample_1(uint64_t* seed) { return 1; } -float sample_few(uint32_t* seed) +float sample_few(uint64_t* seed) { return sample_to(1, 3, seed); } -float sample_many(uint32_t* seed) +float sample_many(uint64_t* seed) { return sample_to(2, 10, seed); } int main(){ // set randomness seed - uint32_t* seed = malloc(sizeof(uint32_t)); + uint64_t* seed = malloc(sizeof(uint64_t)); *seed = 1000; // xorshift can't start with 0 float p_a = 0.8; @@ -35,7 +35,7 @@ int main(){ int n_dists = 4; float weights[] = { 1 - p_c, p_c / 2, p_c / 4, p_c / 4 }; - float (*samplers[])(uint32_t*) = { sample_0, sample_1, sample_few, sample_many }; + float (*samplers[])(uint64_t*) = { sample_0, sample_1, sample_few, sample_many }; float result_one = sample_mixture(samplers, weights, n_dists, seed); printf("result_one: %f\n", result_one); diff --git a/examples/02_many_samples/example b/examples/02_many_samples/example index 6bc060eecfccec875ea56c0c33c5936de18977d0..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_|B70~dh78aKJEg>$PZA{%IykdUUS(7|uv7G38)n-C2$sN2Qs4-}zGL-Z0f(Oq!WJaN4Y9@R7(~ap%{y z9hmztjAf?1BK$3sdD9LgcZI@mlTWj1Ka~d|SS4XyCaeyT*X@&glldgf$zvsPU73Npc_M9Wqi55kBixPJwj@(Ukv z{d)2k`t_RrZ1Q3JcBI__W{tX@Eo+%S;NUpdGbNsXx++UNpSdbrp0P@)W%fnD%gWNI z{X^v4SKC(3I%H_`nr<0RWbWqq4Az=e=B8_)jnaKdQRY!-A1O*bXcg#Yn)d<68C-Q) zQS3CoqA0DPYe5f#?gMQH?E&p3{>O?k2paN%D11jHAl!zdX z+cl&pg`k^9urR2M^J@^)iL;zDLJu?!vL96ucuoVGsUjRl(!ayg!w%)d3fyJ(Zq5|G zg8d_BArJF>i%+Slo-%K?W%4hk>aMVNRF$9|Q9O^OKZhu?ug9T0)A#IFdgC-it{7 zQ^dm{`P0A-0_!1wN^_^IqJ}6$ecu91 zgZ!uF=mR!KMKp{W#oVtbr*w>BIt;8GSO&Rfh~_Q!DoY4nB|K;(?)_`{|G>`XrtsU@ zU~WRN8SZrtGRxfb;C#G(?K&%%n;pCvueWcom*##uoBqGtM$_cL01c|t7%)2;D1Z@O zNIW!pFUt3ziIi4?LL*F=n zI`1j83CEr6L}9VXj;l6}1jZMgB=L8P(vvw{G-;@52fcF?Pac#*u<;49Zt`DU{~D%ZfEZZ(MCFBqUfzWnck3wR(<~mx_Xw5 z=j(WpzS=w;Uou?-p3_Sq0Z%52{A$LR#ztbbZ>jBn Dw70K; diff --git a/examples/04_sample_from_cdf_simple/example.c b/examples/04_sample_from_cdf_simple/example.c index 8f20a4b..0d21ec5 100644 --- a/examples/04_sample_from_cdf_simple/example.c +++ b/examples/04_sample_from_cdf_simple/example.c @@ -49,7 +49,7 @@ void test_inverse_cdf_float(char* cdf_name, float cdf_float(float)) } } -void test_and_time_sampler_float(char* cdf_name, float cdf_float(float), uint32_t* seed) +void test_and_time_sampler_float(char* cdf_name, float cdf_float(float), uint64_t* seed) { printf("\nGetting some samples from %s:\n", cdf_name); clock_t begin = clock(); @@ -75,7 +75,7 @@ int main() // Testing samplers // set randomness seed - uint32_t* seed = malloc(sizeof(uint32_t)); + uint64_t* seed = malloc(sizeof(uint64_t)); *seed = 1000; // xorshift can't start with 0 // Test float sampler diff --git a/examples/05_sample_from_cdf_beta/example b/examples/05_sample_from_cdf_beta/example index 7f3c14e39d926d985fe72bf19cf4bd801c667d9b..853558f01f31952818063528b379fc2e387ec7a4 100755 GIT binary patch delta 7603 zcma)B4OCp!wZ8Ylz%YTi!_V+%_(?J(0|*QR3CSyV1_@kJFw~F;2_!t9@=~>mNmQ(F zIao9>V)|%KU8P-3{pruLtuCvyHrUlV5VZMGLt>g2C0Zo0xns;D0h7|0c;9!lCK9d_U)7@9IpBHJx%cbp@$$FfRE7atd^iMlmWcQfH{OC)}NAhTQ*mO^MWwGJ(s z{79(Nr_ZcJE(`Z16vX;oZ+I?m!5gd+CG)2F7{Agg65}ZNTjYyg|ch1T;r5 zZi@leyv*>e1{@*v2355g7^Wb~aqR}28mqSs1FnUivAPYo?j_3THQ-UY61sk$fe{^K zaNKhSJjQ^(Xuz!o{I>>NG~jy;xR%e1>!)}r{;2h_3{rpg8zyLBXN(a8p3u)*6ch0a z;k#|o8EZLCdeXl`P)4NAVe>vFt=zO2@T8KpWNm-0Er$2r%5h>w1;6Zb=gp5rg zw+h4$dSbeg_J`cCSOC#6Fx$er?~*=aTfq7x)}9m{@|}>BL2%lj906 zVUJ6)Vc+X<#F_L!yoz-WHvm73L7*s(yp)u}XOp*+a=lcr>q~fFqsy^^b9GTW&f_mzwM4RbjFsgl5B;P;eqy&z8 z(*NLcX;99jzNztzze(#8wq`Y*f?TV3-w49|y=COFh8ZZ;{)NI^=K7bzhPj>kxaLy~UsV6dYLS%3PrjAIy$ob^K!&09?UhR!jd8{AVo`@a#HNzTB7houK zxRE(Sont)ZNk=}DqK2r%(3IE!^BYZvs8nlf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tEPo!$L zmG3NmPI$?}{obvGCa{YedNi%>J+r|Ct&dMiXk9;v8%plC6alZA$sA4NYfAEpuDyi# z05>4iVz?0JQEL}`bML9wwCqab`%1DxomzF(JIGa5rP{%Vp+rg^UXHH3>=f7UCqF=b zizYvVe7NEgaNT&|)`oC(QZX)-i|eJ20*mUUuLI2iX<|_@JY%$ov8IL+>VLDmb-4TJ z^eLw9uGDtpW}lh+eb*;5KV$7T^EJMQ4P`v$TNXNk#N%{h_M?hoN1$v-QDy4np71^QPpTZh&i9z&@ zc-oPUgM_TJ*~7w*Z8;m00yg*4#(>S+VXC$Hg*R>9xi)vemQ!Q1*VxQt;2k_UNK-z^ zVG!;x9uIJ;ADH7%W2f=>fr~O0LVw!a!fRz{Tk$f1_wy*f~s$W!4kF=pjX6i;V0GCmpT!tf3EuJ>u`(iv=Rb$?Z zX$&mW>yk3z-j+G4}Ud{b?Ku&s#is;x`4 zlNd%GH_Y2gre2v>S`yR0UDXnTIEZwmL$wcQBn`DC0Ec-`Z8o>pnH_El93!d$X5oRl zZ0@gf3qBXWqi#iNY??-y$@}Yy13s!LMxtK7M@GrOO1+Eg@lNB>?lz~BRbWt2cz~XINrl!$L^EUsI%+9h?q&g&Cl*z@ z&Oe~nA+Z2m8a|yppa+>~Krf#X%r39g#Tut*`cF_RV$|t)_@EATAHeJ<{PkdV?kZ3n zAno*NRBSowxSObk$LY7KlX!$&X1^k^-|3oTdW{l`d^_-N{<`4At_1l7hjhMnd_B=f zEU+Uw-lyZ|X=L?Z36wDZR1I+t5=CPS{Dq{~kpVY}Bc`XQtoz0KUZMN0hJK-Y#x0*G z34h4o=}o0+JM;pg{pL5-p-ne6l{x P!o@cTI~VZ%jYa + // See // https://en.wikipedia.org/wiki/Xorshift // Also some drama: , - uint32_t x = *seed; + uint64_t x = *seed; x ^= x << 13; x ^= x >> 17; x ^= x << 5; @@ -31,7 +31,7 @@ uint32_t xorshift32(uint32_t* seed) uint64_t xorshift64(uint64_t* seed) { // Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" - // See + // See // https://en.wikipedia.org/wiki/Xorshift // Also some drama: , @@ -44,13 +44,13 @@ uint64_t xorshift64(uint64_t* seed) // Distribution & sampling functions // Unit distributions -float sample_unit_uniform(uint32_t* seed) +float sample_unit_uniform(uint64_t* seed) { // samples uniform from [0,1] interval. - return ((float)xorshift32(seed)) / ((float)UINT32_MAX); + return ((float)xorshift64(seed)) / ((float)UINT64_MAX); } -float sample_unit_normal(uint32_t* seed) +float sample_unit_normal(uint64_t* seed) { // See: float u1 = sample_unit_uniform(seed); @@ -60,22 +60,22 @@ float sample_unit_normal(uint32_t* seed) } // Composite distributions -float sample_uniform(float start, float end, uint32_t* seed) +float sample_uniform(float start, float end, uint64_t* seed) { return sample_unit_uniform(seed) * (end - start) + start; } -float sample_normal(float mean, float sigma, uint32_t* seed) +float sample_normal(float mean, float sigma, uint64_t* seed) { return (mean + sigma * sample_unit_normal(seed)); } -float sample_lognormal(float logmean, float logsigma, uint32_t* seed) +float sample_lognormal(float logmean, float logsigma, uint64_t* seed) { return expf(sample_normal(logmean, logsigma, seed)); } -float sample_to(float low, float high, uint32_t* seed) +float sample_to(float low, float high, uint64_t* seed) { // Given a (positive) 90% confidence interval, // returns a sample from a lognormal @@ -88,7 +88,7 @@ float sample_to(float low, float high, uint32_t* seed) return sample_lognormal(logmean, logsigma, seed); } -float sample_gamma(float alpha, uint32_t* seed) +float sample_gamma(float alpha, uint64_t* seed) { // A Simple Method for Generating Gamma Variables, Marsaglia and Wan Tsang, 2001 @@ -125,7 +125,7 @@ float sample_gamma(float alpha, uint32_t* seed) } } -float sample_beta(float a, float b, uint32_t* seed) +float sample_beta(float a, float b, uint64_t* seed) { float gamma_a = sample_gamma(a, seed); float gamma_b = sample_gamma(b, seed); @@ -168,7 +168,7 @@ float array_std(float* array, int length) } // Mixture function -float sample_mixture(float (*samplers[])(uint32_t*), float* weights, int n_dists, uint32_t* seed) +float sample_mixture(float (*samplers[])(uint64_t*), float* weights, int n_dists, uint64_t* seed) { // You can see a simpler version of this function in the git history // or in C-02-better-algorithm-one-thread/ @@ -364,13 +364,13 @@ struct box inverse_cdf_box(struct box cdf_box(float), float p) } // Sampler based on inverse cdf and randomness function -struct box sampler_cdf_box(struct box cdf(float), uint32_t* seed) +struct box sampler_cdf_box(struct box cdf(float), uint64_t* seed) { float p = sample_unit_uniform(seed); struct box result = inverse_cdf_box(cdf, p); return result; } -struct box sampler_cdf_float(float cdf(float), uint32_t* seed) +struct box sampler_cdf_float(float cdf(float), uint64_t* seed) { float p = sample_unit_uniform(seed); struct box result = inverse_cdf_float(cdf, p); @@ -378,7 +378,7 @@ struct box sampler_cdf_float(float cdf(float), uint32_t* seed) } /* Could also define other variations, e.g., -float sampler_danger(struct box cdf(float), uint32_t* seed) +float sampler_danger(struct box cdf(float), uint64_t* seed) { float p = sample_unit_uniform(seed); struct box result = inverse_cdf_box(cdf, p); diff --git a/squiggle.h b/squiggle.h index a94158f..aa3399b 100644 --- a/squiggle.h +++ b/squiggle.h @@ -1,24 +1,24 @@ #ifndef SQUIGGLEC #define SQUIGGLEC -// uint32_t header +// uint64_t header #include // Pseudo Random number generator -uint32_t xorshift32(uint32_t* seed); +uint64_t xorshift64(uint64_t* seed); // Basic distribution sampling functions -float sample_unit_uniform(uint32_t* seed); -float sample_unit_normal(uint32_t* seed); +float sample_unit_uniform(uint64_t* seed); +float sample_unit_normal(uint64_t* seed); // Composite distribution sampling functions -float sample_uniform(float start, float end, uint32_t* seed); -float sample_normal(float mean, float sigma, uint32_t* seed); -float sample_lognormal(float logmean, float logsigma, uint32_t* seed); -float sample_to(float low, float high, uint32_t* seed); +float sample_uniform(float start, float end, uint64_t* seed); +float sample_normal(float mean, float sigma, uint64_t* seed); +float sample_lognormal(float logmean, float logsigma, uint64_t* seed); +float sample_to(float low, float high, uint64_t* seed); -float sample_gamma(float alpha, uint32_t* seed); -float sample_beta(float a, float b, uint32_t* seed); +float sample_gamma(float alpha, uint64_t* seed); +float sample_beta(float a, float b, uint64_t* seed); // Array helpers float array_sum(float* array, int length); @@ -27,7 +27,7 @@ float array_mean(float* array, int length); float array_std(float* array, int length); // Mixture function -float sample_mixture(float (*samplers[])(uint32_t*), float* weights, int n_dists, uint32_t* seed); +float sample_mixture(float (*samplers[])(uint64_t*), float* weights, int n_dists, uint64_t* seed); // Box struct box { @@ -47,7 +47,7 @@ struct box inverse_cdf_float(float cdf(float), float p); struct box inverse_cdf_box(struct box cdf_box(float), float p); // Samplers from cdf -struct box sampler_cdf_float(float cdf(float), uint32_t* seed); -struct box sampler_cdf_box(struct box cdf(float), uint32_t* seed); +struct box sampler_cdf_float(float cdf(float), uint64_t* seed); +struct box sampler_cdf_box(struct box cdf(float), uint64_t* seed); #endif diff --git a/test/test b/test/test index 932cb620ade5cf6cea1ea06ced2593d8458c7867..708e1fffaaafad773cdd48fedd1ba858f1b6889f 100755 GIT binary patch delta 5325 zcma)AeNa@_6@Tx+!h*1O`B*^^Sz*;(5*JAEBdJu@2s~1(Aee{{qc&kMHi^}wwV6y7 z#mMd`33{99*EDLHv8I1GCfjL;Hcb{ZjTjrzW;!OMaf3E_D=~a58b9;;yZ7zFf^5v4 zd3)YH_uO;N{hf2qy>FWji-!)2?N+gAkL_Ii%QFPtUYp$8Ds|hO4b}AthpwFW96YstPJ@5Xp7k$#o{RdE!Nz9Q{QXh<$}L}}E5A}zRen!U zqR@B0C%fNO9uozjUr(~>^5hJuCYEkYo-WOcrS9ZqaR)OY)s~o_NzWypi;622XlF|5 za!``JgPWJ#19HpJXr(Ax5CSCW{+pHeo`2@z+a*hgQ0X2}+K3>8I>hP=kcL?^uqa3_ zwItxzVo~yp9!qMT$dy-{%uBfP5{MWpEk^t8pPPK5Q+9XBoqdUNVVCUgkvo;7(3?*u7xuVg-QJ@lyP2&eKxSN*cg0Se5IZ^n zQ+s50Y$SP%!PG^_Yj1r_9`<9mPHiLu-hfQTyIOoA84aTdN@7H+1L(WTKd?^yXDh7Si_}(Q=O8I$>E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/test/test.c b/test/test.c index 7c5943d..7e472f6 100644 --- a/test/test.c +++ b/test/test.c @@ -4,9 +4,9 @@ #include #include -#define N 10 * 1000 * 1000 +#define N 1000 * 1000 -void test_unit_uniform(uint32_t* seed){ +void test_unit_uniform(uint64_t* seed){ float* unit_uniform_array = malloc(sizeof(float) * N); for(int i=0; i