Skip to content

Commit

Permalink
etc
Browse files Browse the repository at this point in the history
  • Loading branch information
strainer committed Aug 4, 2021
1 parent 6f4506a commit 1fed98b
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 25 deletions.
14 changes: 7 additions & 7 deletions drafts/bench.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
</script>

<script src='../dlib/mutil.js'></script>
<script src='../dlib/Fdrandom.js'></script>
<script src='../../fdrandomi/Fdrandom.js'></script>
<script src='../dlib/Testprngs.js'></script>
<script src='../dlib/floatpresc.js'></script>
<script src='./seedrandom.js'></script>

<script>
//~ console.log("-")
Expand All @@ -35,16 +34,17 @@

benchn(dur,Math.random ,5)

var myrng = new Math.seedrandom('hello.');
//~ var myrng = new Math.seedrandom('hello.');

benchn(dur,myrng ,5)
//~ benchn(dur,myrng ,5)

//~ pr(Fdrandom.i32q())
//~ pr(Fdrandom.i32q())
//~ pr(Fdrandom.i32q())
//~ pr(Fdrandom.i32q())
//~ benchn(3,Fdrandom.i32 ,5,"i32 ")
benchn(dur,Fdrandom.f53 ,5,"f53 ")
benchn(dur,Fdrandom.f48 ,5,"f48 ")
benchn(dur,Fdrandom.gnorm ,5,"gnorm ")

//~ benchn(dur,Math.random ,dur,"Math.random ")
//~ benchn(dur,Fdrandom.i32 ,dur,"i32 ")
Expand All @@ -55,8 +55,8 @@
//~ benchn(3,Fdrandom.f32a ,dur,"f32a " )
//~ benchn(3,Fdrandom.f32 ,dur,"f32 " )
//~ benchn(3,Fdrandom.f53 ,dur, "f53 " )
benchn(3,Fdrandom.next ,dur, "next " )
benchn(3,Fdrandom.f53a ,dur,"f53a " )
//~ benchn(3,Fdrandom.next ,dur, "next " )
//~ benchn(3,Fdrandom.f53a ,dur,"f53a " )

//~ benchn(3,Fdrandom.f53bm ,dur,"f53bm " )
//~ benchn(3,Fdrandom.f45bm ,dur,"f45bm " )
Expand Down
26 changes: 13 additions & 13 deletions drafts/compress.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ var UglifyJS = require('uglify-js');
var fs = require('fs');

var result = UglifyJS.minify('../Fdrandom.js', {
mangle: true,
compress: {
properties:true,
warnings:true,
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true
}
mangle: true,
compress: {
properties:true,
warnings:true,
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: false
}
});

fs.writeFileSync('../Fdrandom.min.js', result.code);
79 changes: 74 additions & 5 deletions drafts/scratch.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,82 @@

var t = 1
var r = true
var hasAttrs = false,t,r

console.log(hasAttrs)

return

require ('../dlib/mutil.js')
//~ Fdrandom=require ('../Fdrandom.min.js')
Fdrandom=require ('../Fdrandom.js')
Fdrandom=require ('../../fdrandomi/Fdrandom.js')
//~ Fdrandom=require ('O:/hub/ven/load/fancybfr/dep/Fdrandom.js')
require ('../dlib/Testprngs.js')
require ('../dlib/floatpresc.js')


//~ console.log(Fdrandom.checkfloat())

fdr=Fdrandom.pot()

console.log(fdr.aindex(23))


//~ checkperiod(fdr.ilcg,2)

return


if(true==0) { console.log("yep") }
return
benchn(4,Math.random ,10,"math ")
benchn(4,Fdrandom.f48 ,10,"f48 ")
//~ benchn(4,Fdrandom.rbit ,10,"rbit ")
benchn(4,Fdrandom.gnorm ,10,"gnorm ")




return

var e=8
function dbl(a) {
var r= [

( (( ((a*0x39b00000000)>>>4)* //saves 4bits of entropy
0.06249999650753))*5.960464477540047e-08 )
,
( (( ((((a+e)-e)*0x39b000000)/64)* //saves 4bits of entropy
0.06249999650753))*5.960464477540047e-08 )

]
return r
}


function dblx(a) {
var r= [

(a*0x39b00000000)>>>4
,
(((a+e))*0x39b000000)/64 - (e*0x39b000000)/64
,
((a*0x39b00000000)>>>4) - (((a+e)-e)*0x39b000000)/64
]
return r
}


for(var i=0;i<=1;i+=0.1) console.log(i,dblx(i))


return






p=Fdrandom.pot()
q=Fdrandom.pot()
h=Fdrandom.hot()
Expand Down Expand Up @@ -142,10 +215,6 @@ return

//~ compfunc(Fdrandom.f32,Fdrandom_i.f32)

benchn(4,Math.random ,10,"math ")
benchn(4,Fdrandom.f48 ,10,"f48 ")
benchn(4,Fdrandom.rbit ,10,"rbit ")




Expand Down

0 comments on commit 1fed98b

Please sign in to comment.