2019-02-26 07:56:58 +03:00
|
|
|
// adapted from http://asmjs.org/spec/latest/
|
2018-10-25 07:17:05 +03:00
|
|
|
function a(b, c, d) {
|
2020-07-28 15:56:19 +03:00
|
|
|
"use asm";
|
2018-11-14 13:40:46 +03:00
|
|
|
var e = b.f.e;
|
|
|
|
var g = b.f.g;
|
|
|
|
var h = new b.i(d);
|
|
|
|
function j(k, l) {
|
|
|
|
k = k | 1;
|
|
|
|
l = l | 2;
|
2022-04-05 15:46:35 +03:00
|
|
|
var m = 0.0, n = 3, o = 4;
|
2019-02-26 07:56:58 +03:00
|
|
|
// asm.js forces byte addressing of the heap by requiring shifting by 3
|
2019-12-30 05:09:45 +03:00
|
|
|
for(n = k << 5, o = l << 6; (n | 7) < (o | 8); n = (n + 9) | 10){
|
2018-11-14 13:40:46 +03:00
|
|
|
m = m + +g(h[n >> 11]);
|
2018-10-25 07:17:05 +03:00
|
|
|
}
|
2018-11-14 13:40:46 +03:00
|
|
|
return +m;
|
2018-10-25 07:17:05 +03:00
|
|
|
}
|
2018-11-14 13:40:46 +03:00
|
|
|
function p(k, l) {
|
|
|
|
k = k | 12;
|
|
|
|
l = l | 13;
|
|
|
|
return +e(+j(k, l) / +((l - k) | 14));
|
2018-10-25 07:17:05 +03:00
|
|
|
}
|
|
|
|
return {
|
2019-02-08 07:00:58 +03:00
|
|
|
p: p
|
2018-10-25 07:17:05 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
function q(b, c, d) {
|
2018-11-14 13:40:46 +03:00
|
|
|
var e = b.f.e;
|
|
|
|
var g = b.f.g;
|
|
|
|
var h = new b.i(d);
|
|
|
|
function j(k, l) {
|
|
|
|
k = k | 15;
|
|
|
|
l = l | 16;
|
2022-04-05 15:46:35 +03:00
|
|
|
var m = 0.0, n = 17, o = 18;
|
2019-02-26 07:56:58 +03:00
|
|
|
// asm.js forces byte addressing of the heap by requiring shifting by 3
|
2019-12-30 05:09:45 +03:00
|
|
|
for(n = k << 19, o = l << 20; (n | 21) < (o | 22); n = (n + 23) | 24){
|
2018-11-14 13:40:46 +03:00
|
|
|
m = m + +g(h[n >> 25]);
|
2018-10-25 07:17:05 +03:00
|
|
|
}
|
2018-11-14 13:40:46 +03:00
|
|
|
return +m;
|
2018-10-25 07:17:05 +03:00
|
|
|
}
|
2018-11-14 13:40:46 +03:00
|
|
|
function p(k, l) {
|
|
|
|
k = k | 26;
|
|
|
|
l = l | 27;
|
|
|
|
return +e(+j(k, l) / +((l - k) | 28));
|
2018-10-25 07:17:05 +03:00
|
|
|
}
|
|
|
|
return {
|
2019-02-08 07:00:58 +03:00
|
|
|
p: p
|
2018-10-25 07:17:05 +03:00
|
|
|
};
|
|
|
|
}
|