-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fdrandom.min.js
1 lines (1 loc) · 10 KB
/
Fdrandom.min.js
1
var newFdrandom=function(){var n;return function(r){"use strict";function t(n){function r(n){var t,e=typeof n;if("string"!==e){if(!(0>pn))if("object"!==e){if("boolean"===e)return kn[0]*=.93,void(n&&d());if(isFinite(n))return t=0>=n?1.234020348919-n:n,t=ln(t,15.034271450894243),kn[0]=.1*kn[0]+.8999999*t,void d();if("function"===e)return kn[0]*=.91,void r(n.name);"symbol"===e&&(kn[0]*=.89),d()}else{if(pn--,n.constructor===Array){for(kn[0]*=.95,t=0;t<n.length;t++)r(n[t]);return}if(null===n)return void(kn[0]*=.97);kn[0]*=.93;for(t in n)n.hasOwnProperty(t)&&(r(t),r(n[t]))}}else for(e=n.length,e>100*pn&&(e=100*pn,pn--),t=0;e>t;t++)kn[0]=(kn[0]+65537-n.charCodeAt(t))/6474.10101,d()}for(pn=1e3,hn=1,bn=3,An=4,gn=yn=wn=Fn=jn=qn=-0,xn=-.1,mn=2e15,Mn=1,kn=[.1,.2,.3,.4,.5,.6,.7,.8],r(n),Cn=0;98>Cn;Cn++)d();pn=g(3206324,3259829),Fn=.5+.75487766624669*kn[0],jn=.5+.56984029099805*kn[0],Fn-=Fn>>>0,jn-=jn>>>0}function e(){var n=newFdrandom([3,2],2450,"~fez",{c:.1});for(Cn=0;1e6>Cn;Cn++)n.dbl();return.6630336428202791===n.dbl()}function o(){return[kn[0],kn[1],kn[2],kn[3],kn[4],kn[5],kn[6],kn[7],Mn,pn,hn,yn,wn,mn,bn,An,Fn,jn,qn,xn,gn]}function i(n){for(Cn=0;8>Cn;Cn++)kn[Cn]=n[Cn];Mn=n[8],pn=n[9],hn=n[10],yn=n[11],wn=n[12],mn=n[13],bn=n[14],An=n[15],Fn=n[16],jn=n[17],qn=n[18],xn=n[19],gn=n[20],zn=n}function u(){return newFdrandom(arguments)}function f(n){return void 0===n?i(zn):t({0:{0:n}}),this}function a(){if("undefined"!=typeof window&&(window.crypto||window.msCrypto))var n=window.crypto||window.msCrypto,r=[n.getRandomValues(new Uint32Array(8))];else r=[(new Date).getTime()-1332e9,Math.random()];return r.push(arguments),newFdrandom(r)}function c(){return n||(n=a()),n}function d(){var n=.12810301030196883*kn[0]+15.378612015061215*(1.0000000000000038-kn[Mn=7===Mn?1:Mn+1]);return kn[Mn]=n-((kn[0]=n)>>>0)}function l(){return 5.960464477540047e-8*(.06249999650753*(3964254814208*d()>>>4)+d())}function v(){return.99999997019767*d()}function s(n,r){return d()*(r-n)+n}function g(n,r){return Math.floor(d()*(r-n+1)+n)}function p(){return 98784247808*d()|0}function h(){return 98784247808*d()>>>0}function y(){return 2147483648>mn?1&(mn*=2):1&(mn=l()+.5)}function w(){return 2147483648>mn?(2&(mn*=2))-1:(2&(mn=l()+1.5))-1}function m(){return hn=13229323*hn^3962102927}function b(){return pn^=(pn<<7)+1498916339,pn^=pn>>>8}function A(){return hn=13229323*hn^3962102927,hn^(hn<<7)+1498916339}function F(){return(h()&h())>>>0}function j(){return(h()|h())>>>0}function q(){return((h()&h())>>1)+((h()|h())>>1)}function x(){return((h()&h())>>1)-((h()|h())>>1)}function M(n,r,t){return k(r,t,n)}function k(n,r,t){if(n=void 0===n?-1:n,r=void 0===r?1:r,t=void 0===t?.5:t,t>.5){if(d()>2*t-1)return d()*(r-n)+n}else if(d()<2*t)return d()*(r-n)+n;var e=.3333333*(1.333*d()+d()+.66666*d())-.5;return e=t>.5?e:e>0?.5-e:-.5-e,n+(r-n)*(e+.5)}function z(n,r,t){t=void 0===t?1:Math.sqrt(t);var e=[S,Q,Y,V,K,L],o=d(),i=.001*xn,u=.002*t;if(xn>1e3?(xn=ln(xn,1e3),bn=An,Fn=jn,An=bn>7?g(0,7):g(0,9),jn=d()):0>xn&&(0>bn&&(bn=g(0,8),Fn=d()),xn=ln(xn,1e3),An=bn,jn=Fn,bn=An>7?g(0,7):g(0,9),Fn=d()),xn+=(o-.3333)*t,Fn+=(d()-.5)*u,Fn=Fn>1?1:0>Fn?0:Fn,jn-=(d()-.5)*u,jn=jn>1?1:0>jn?0:jn,6>bn)var f=e[bn](-1+Fn,Fn);else f=8>bn?I(0,-1+Fn,Fn):k(-1+.85*Fn,.85*Fn+.15,.7*jn);if(6>An)var a=e[An](-1+jn,jn);else a=8>An?D(-1+jn,jn,.5):k(-1+.85*jn,.85*jn+.15,.7*Fn);return C(n,r,.5*(a*i-f*i+f)+.5)}function C(n,r,t){return n=void 0===n?0:n,n+t*((void 0===r?1:r)-n)}function N(n,r,t){return n=void 0===n?-1:n,n+t*((void 0===r?1:r)-n)}function D(n,r,t){return yn+=.5*(t=t||.66666666*d()),yn+=(1-t)*d(),C(n,r,yn-=yn>>>0)}function I(n,r,t){return wn+=.5*(n=n||.66666666*d()),wn+=(1-n)*d(),C(r,t,wn-=wn>>>0)}function O(n,r,t){return t=void 0===t?.5:t,.5*(D(n,r,t)+I(t,n,r))}function P(n,r,t){t=t||.5*d(),yn+=.5*t+(1-t)*d();var e=yn-=yn>>>0;return yn+=.5*t+(1-t)*d(),C(n,r,.5*(1+e-(yn-=yn>>>0)))}function R(n,r,t){t=void 0===t?.5:t;var e=.5*t;yn+=(1-t)*d()+e;var o=yn-=yn>>>0;return yn+=(1-t)*d()+e,o-=yn-=yn>>>0,yn+=(1-t)*d()+e,o+=yn-=yn>>>0,yn+=(1-t)*d()+e,o-=yn-=yn>>>0,r=void 0===r?1:r,C(n,r,.3333333333*o+.5)}function T(n,r){var t=Nn(d())+Nn(d());return C(n,r,.75*(1.333333333-t))}function U(n,r){var t=.5*d();return t=Nn(Nn(t))+.21*t*t*Nn(t),C(n,r,1-1.138926841352*t)}function V(n,r){var t=!1,e=d();return e>.5&&(e=1-e,t=!0),e=Nn(Nn(e))+.21*e*e*Nn(e),N(n,r,.569463420676*(t?e:1.756039042532-e))}function B(n,r){return C(n,r,.75*(1.333333333-(Nn(d())+Nn(d()))))}function E(n,r,t){return t=void 0===t?1:t*t*4,C(n,r,d()*t/(d()+t))}function G(n,r){return C(n,r,1-Nn(d()))}function H(n,r){return N(n,r,.5*(1+(d()-d())*d()))}function J(n,r){return N(n,r,.5*(1+(Dn(d()-d())-Dn(d()-d()))))}function K(n,r){var t=V();return t=Dn(t)<.0625?.5*w():t,N(n,r,.5+.03125*V()/t)}function L(n,r){var t=d();return t=t>.5?Nn(Nn(1-t)):1.6817928305074-Nn(Nn(t)),N(n,r,.59460355750137*t)}function Q(n,r){var t=d();return t>.842105263&&(t-=.2631578947),t>.47368421&&(t-=.4210526316),N(n,r,2.1111111134*t)}function S(n,r){var t=!1,e=d();return e>.5&&(e=1-e,t=!0),e=Nn(Nn(e)),N(n,r,.5946035575*(.840896415253+(t?e:-e)))}function W(n,r,t){t=void 0===t?-.4:t;var e=1.4142135623731+.5*t,o=!1,i=d();return i>.5&&(i=1-i,o=!0),i=Nn(i)+t*i*i,N(n,r,(o?i:e-i)/e)}function X(n,r){return N(n,r,.5*(.5+(.5-d())*d()+d()))}function Y(n,r){return N(n,r,.5+.33333333*(.5+d()-2*d()))}function Z(n,r){return Fn+=.61803398874989,N(n,r,Fn-=Fn>>>0)}function $(n,r){return n=void 0===n?-1:n,r=void 0===r?1:r,Fn+=.75487766624669,Fn-=Fn>>>0,jn+=.56984029099805,jn-=jn>>>0,[Fn*(r-n)+n,jn*(r-n)+n]}function _(n,r){return n=void 0===n?-1:n,r=void 0===r?1:r,qn==-.1&&(Fn=kn[0]+.81917251339616*kn[1],jn=kn[0]+.67104360670379*kn[1],qn=kn[0]+.54970047790197*kn[1],Fn-=Fn>>>0,jn-=jn>>>0,qn-=xn>>>0),Fn+=.81917251339616,Fn-=Fn>>>0,jn+=.67104360670379,jn-=jn>>>0,qn+=.54970047790197,qn-=qn>>>0,[Fn*(r-n)+n,jn*(r-n)+n,qn*(r-n)+n]}function nn(n,r,t){for(var e=1==(1&(n=n||2))?.5:0,o=0;n>o;o++)e=d()-e;return void 0===r?e:(r!==In&&(In=r,On=3.47*r/Nn(n)),(t||0)+e*On)}function rn(n,r){return on(d,n,r)}function tn(n,r){return on(l,n,r)}function en(n,r){return(r||0)+(n||1)*on(d)/(on(d)||.5)}function on(n,r,t){var e,o,i;if(gn)return o=gn,gn=0,r?o*r+(t||0):o;do e=2*n()-1,o=2*n()-1,i=e*e+o*o;while(i>=1);return i=Nn(-2*Math.log(i)/i),gn=e*i,r?o*i*r+(t||0):o*i}function un(n,r,t,e,o){var i=1,u="",f=0;"string"==typeof n?n=n.split(""):i=0,"number"!=typeof r?void 0===r?(t=1,r=[]):(f=r.length,"string"==typeof r?(u=r,f=0,i=1):i=0,0===f&&(r=new Array(t||1))):(o=e,e=t,t=r||1,r=new Array(t)),t=(t||1)+f,e=e||0,o=o||n.length-1,o++;for(var a=f;t>a;a++)r[a]=n[e+d()*(o-e)>>>0];return i?r=u+r.join(""):r}function fn(n,r,t,e){var o=0,i="",u=0,f=0;if("string"==typeof n&&(n=n.split(""),o=1),"string"!=typeof r&&"object"!=typeof r)e=1+(t||n.length-1),t=r||0,r=n;else if(t=t||0,e=1+(e||n.length-1),"string"==typeof r){for(i=r,o=1,r=new Array(e-t),e-=t,f=0;e>f;f++)r[f]=n[f+t];t=0}else{o=null,u=r.length,0===u&&(r=new Array(e-t));var a=t-u;for(f=u;u+e-t>f;f++)r[f]=n[a+f];t=u,e=r.length}for(var c,l,v=e-1;v>t;)c=Math.floor(t+d()*(e-t)),l=r[t],r[t++]=r[c],r[c]=l;return o?r=i+r.join(""):r}function an(n,r,t,e,o,i){var u,f;if("boolean"!=typeof n&&(i=o,o=e,e=t,t=r,r=n,n=!0),"object"!=typeof r||isNaN(parseFloat(r[0]))||!isFinite(r[0])||"string"==typeof e&&"pos"===e)for(u=new Array(r>0?r:r.length),"undefined"==typeof t&&(t=1),"pos"===e&&(e=o,o=i),f=0;f<u.length;f++)u[f]=f;else u=r,t=t||0;for(var a=u.length,c=a>50?50:a-1,d=a>350?350:a-1,l=new Array(a),f=0;a>f;f++)l[f]=f;if(1>a)return l;if(n&&fn(l),2==a)return 0>t^u[l[1]]>u[l[0]]?[l[1],l[0]]:l;var v=!1,p=0===e?"zero":e,h=.5*e;if("undefined"==typeof e||"auto"===e){var y=0,w=.33*a|0,m=1+.66*a|0;for(f=0;d>f;f++)y+=Dn(u[f]-u[(w+f)%a])+Dn(u[(w+f)%a]-u[(m+f)%a])+Dn(u[(a+m-f)%a]-u[(a-f)%a]);v=!0,e=p=y/(10*d),h=.5*e}10>a&&(v=!1),o||(o=.001*(a+5e5));for(var b=8e3*o,A=.3*b,F=0,j=0,q=0,x=0,M=g(1,a-1),k=a+3,x=0,z=!1;k>0&&b>0;){var C=ln(M=0>M?M+a:M,a),N=C+1,D=C+2,I=C+3;I>=a&&(I-=a,D=ln(D,a),N=ln(N,a));var O=0,P=1;if(v&&(e=p*s(.83333,1.2),h=.5*e),Dn(u[l[N]]-u[l[D]]+t)<e){for(x=g(2,d)+N,q=x+c,O=1,P=-2,z=A>b;O&&q>x;)j=ln(x,a),Dn(u[l[D]]-u[l[j]]+t)>=e&&Dn(u[l[(j+1)%a]]-u[l[N]]+t)>=e&&(z||Dn(u[l[I]]-u[l[j]]+t)>=h)&&(O=0,F=l[N],l[N]=l[j],l[j]=F,x-N+2>k&&(k=x-N+2)),x++;var R=.5*(x-q+c);b-=R,O&&(F=l[C],l[C]=l[N],l[N]=F),v&&(p*=.0151466*(66-(R-2)/c))}else if(b>A&&Dn(u[l[N]]-u[l[I]]+t)<h){for(O=1,x=g(2,d)+N,q=x+c;O&&q>x;)j=ln(x,a),Dn(u[l[D]]-u[l[j]]+t)>=e&&Dn(u[l[(j+1)%a]]-u[l[I]]+t)>=e&&Dn(u[l[N]]-u[l[j]]+t)>=h&&(O=0,F=l[I],l[I]=l[j],l[j]=F,x-N+2>k&&(k=x-N+2)),x++;b-=.5*(x-q+c)}M+=P,k-=P,b--}return xn=v?b>A?.81*p:1>b?0:.8*-p:b>A?p:1>b?0:-p,l}function cn(n,r,t){if(!n)return xn;var e,o=n.length,i=1/0;if("object"!=typeof r)for(Cn=0;o>Cn;Cn++)e=Dn(n[Cn]-n[(Cn+1)%o]+(r||0)),i>e&&(i=e);else for(Cn=0;o>Cn;Cn++)e=Dn(r[n[Cn]]-r[n[(Cn+1)%o]]+(t||0)),i>e&&(i=e);return xn>0||"zero"===xn?i:-i}function dn(n,r,t,e,o,i,u){"boolean"!=typeof n&&(u=i,i=o,o=e,e=t,t=r,r=n,n=!0);var f,a=0,c=r.length,d=[];for("object"!=typeof t?(u=i,i=o,o=e,e=t,d=new Array(c)):(d=t,a=t.length),f=an(n,r,e,o,i,u),Cn=0;c>Cn;Cn++)d[a+Cn]=r[f[Cn]];if("object"!=typeof t)for(Cn=0;c>Cn;Cn++)r[Cn]=d[a+Cn];return d}function ln(n,r){return n-Math.floor(n/r)*r}function vn(n,r,t,e,o){"object"!=typeof n&&(n=new Array(parseInt(n)||1));var i=0,u=n.length;for(r=r||d;u>i;)n[i++]=r(t,e,o);return n}function sn(n,r,t,e){var o;for(e=e||5;e--;)if(o=t(),o>=n&&r>=o)return o;return s(n,r)}var gn,pn,hn,yn,wn,mn,bn,An,Fn,jn,qn,xn,Mn,kn,zn,Cn,Nn=Math.sqrt,Dn=Math.abs;t(r),zn=o();var In,On;return{pot:u,hot:c,hotpot:a,repot:f,reset:f,getstate:o,setstate:i,checkfloat:e,next:d,random:d,f48:d,dbl:l,f24:v,fxs:l,i32:p,ui32:h,rbit:y,rpole:w,range:s,irange:g,lrange:M,zrange:z,vrange:k,cauchy:en,gaus:rn,gausx:tn,usum:nn,uigless:F,uigmore:j,igbrist:q,igmmode:x,ilcg:m,ishr2:b,ishp:A,gbowl:S,gspire:W,gthorn:H,gwedge:J,gnorm:V,gcauchy:K,gskip:I,gteat:X,gtrapez:Y,qskip:D,qxskip:O,qhop:P,qtrip:R,qr1fill:Z,qr2fill:$,qr3fill:_,fillr1:Z,fillr2:$,fillr3:_,gspill:E,ggrad:G,ngrad:U,gskew:B,gbands:Q,ghorn:L,gpick:W,mixup:fn,mixof:un,aindex:an,aresult:cn,antisort:dn,bulk:vn,within:sn,dev2:T,version:function(){return"v3.3.0"}}}(arguments)};"undefined"!=typeof module&&module.exports?module.exports=newFdrandom():"undefined"!=typeof window?window.Fdrandom=newFdrandom():console.log("Fdrandom.js did not import");