-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfdrandom.api
85 lines (63 loc) · 5.59 KB
/
fdrandom.api
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
checkfloat() return true if host platforms float math is compliant for expected results
version() return version
pot([seeding variable or object]) return a seeded new instance of fdrandom
repot([seeding variable or object]) resets or reseeds this instance of fdrandom
hot([extra seeds]) return a randomly seeded instance of fdrandom
hotpot([extra seeds]) return a randomly seeded new instance of fdrandom
getstate() return array of parents state for setstate
setstate(state_array) sets state with state array returned by getstate
f48() return 48bit precision equally distributed variates 0 to 0.9999999999999999
next() alias of f48()
random() alias of f48()
dbl() return 53bit precision equally distributed variates 0 to 0.9999999999999999
f24() return 48bit precision equally distributed variates 0 to 0.99999994
gnorm([a=-1][,b=1]) return approximate normally distributed reals in range a to b
range(a,b) return equally distributed reals in range a to <b
irange(a,b) return equally distributed integer in range a to b inclusive
lrange([loaded=0.5][,a=-1][,b=1]) return loaded distribution through range a to b where L=0:High ends|0.5=Flat|1=Middle peaked
vrange([a=-1][,b=1][,loaded=0.5]) return loaded distribution through range a to b where L=0:High ends|0.5=Flat|1=Middle peaked
zrange([a=-1][,b=1][,K=1]) return a semi-randomly altering combination of two distributions. Output range is a to b. K=0:combination does not change, k=1:changes over 100s outputs, K=100:changes every few calls, k>1000:almost every call.
i32() return signed integer randoms
ui32() return unsigned integer randoms
rbit() return random 0 or 1
rpole() return random -1 or 1
ilcg() return signed 32bit integer ok but weak lcg randoms
ishr2() return slightly patterned 32bit shift register randoms
ishp() return fast good quality 32bit integer randoms
uigless() return unsigned ints in a patterned distribution favouring low values
uigmore() return unsigned ints in a patterned distribution favouring high values
igbrist() return signed ints in a patterned distribution peaking in values
igmmode() return signed ints in patterned unsymetric but balanced distribution
gbowl([a=-1][,b=1]) return bowl shaped distribution in range a to b
gspire([a=-1][,b=1]) return spire shaped distribution in range a to b
gthorn([a=-1][,b=1]) return thorn shaped distribution in range a to b
ghorn([a=-1][,b=1]) return sharp normal shaped distribution in range a to b
gwedge([a=-1][,b=1]) return wedge shaped distribution in range a to b
gteat([a=-1][,b=1]) return teat shaped distribution in range a to b
gtrapez([a=-1][,b=1]) return trapeziod shaped distribution in range a to b
gspill([a=0][,b=1][,edge=0to1]) return linear dist in range drops off from edge
ggrad([a=0][,b=1]) return linear gradient distribtion
ngrad([a=0][,b=1]) return half bell shaped gradient distribtion
gbands([a=-1][,b=1]) return triangular dist approximated in 5 bands
gskew([a=0][,b=1]) return left skewed dist average middle
gpick([a=0][,b=1][,dev=0.4]) return mid peaked dist configurable deviation
gskip([skip=f48()/3][,a=0][,b=1]) return quasirandom reals cycling a to b, skipping variably or by skip as factor of range
qskip([a=0][,b=1][,skip=f48()/3]) return quasirandom reals cycling a to b, skipping variably or by skip as factor of range
qxskip([a=0][,b=1][,focus=0.5) return quasirandom stumbling reals cycling a to b, skipping variably or by skip as factor of range
qhop([a=0][,b=1][,focus=0.5) return quasirandom hopping reals cycling a to b, skipping variably or by skip as factor of range
qtrip([a=0][,b=1][,focus=0.5) return quasirandom 3 hopping reals cycling a to b, skipping variably or by skip as factor of range
fillr1([a=-1][,b=1]) return a filling pattern in range a to b
fillr2([a=-1][,b=1]) return 2d array filling pattern for square of sides a to b
fillr3([a=-1][,b=1]) return 3d array filling pattern for cube of sides a to b
usum(n[,stnddev=1][,mean=0]) return uniform sum of n equal distributed randoms
gaus([stnddev=1][,mean=0]) return gaussion variates
gausx([stnddev=1][,mean=0]) return extra precision gaussion variates
cauchy([scale=1][,mean=0]) returns cauchy distribution - the ratio of two gaussians
gcauchy([a=-1][,b=1]) returns cauchy like distribution
mixof (in [,out=intype][,n=1][,in_start=0][,in_fin=len]) return new or given output array or string consisting of n randomly choosen elements from elements|chars in_start to in_fin
mixup(in [,out=in][,inStart=0][,fin=inLen]) shuffles positions of array or string, inplace or adds to end of out array or string. return the input or output string|array.
antisort([premix:boolean,] inArray or length [,outArray=inArray][,orderIncrement=auto][,posmode=off|"pos"][,sep="auto"][,bogoMilliSecTimeout=auto]) return input array shuffled randomly with sequential elements separated by approx 10% numeric range or by 10% source-index-range if "pos" set or first element is not finite.
aindex([premix:boolean,] Array [,orderIncrement=auto][,posmode=off|"pos"][,sep="auto"][,bogoMilliSecTimeout=auto]) return index of array antisorted by numeric value or element "index" if specified or non numeric. eg. for shuffling a playlist
aresult([indexArray][,valueArray][,orderIncrement]) return estimated minimum separation achieved on last antisort. Signless but return negative if only direct neighbours could be separated. If relevant arrays are supplied the definite value is calculated.
bulk(in_array|new_array_len [,func=f48][,func param][,func param][,func param]) return the input or a new array filled with func,params
within(lo,hi,fnc[,tn=8]) try fnc for a result within lo>hi. return range(lo,hi) if not produced by fnc after tn tries.