I'm testing asm.js with F30, here is a module it compiles, featuring 0 A.D. cos() implementation:HANNIBAL = (function(H){ H.ASM = (function(stdlib, foreign, heap) { "use asm"; var PI = 3.141592653589793, arr = new stdlib.Int8Array(heap), sqrt = stdlib.Math.sqrt, abs = stdlib.Math.abs; function cos (a){ a = +a; var b = 0.0, c = 0.0; a = (a + PI) % (2.0*PI); a = +abs((2.0*PI + a) % (2.0*PI) - PI); b = (a-PI/2.0) + +abs(a-PI/2.0); b = b / (b + +(1e-30)); // normalize b to one while avoiding divide by zero errors. a = b * PI - a; c = 1.0 - 2.0 * b; // sign of the output return +(c * (1.0 - a*a*(0.5000000025619951 - a*a*(1.0/24.0 - a*a*(1.0/720.0 - a*a*(1.0/40320.0 - a*a*(1.0/3628800.0 - a*a/479001600.0))))))); } function sin (a){ a = +a; return +(cos(a - PI/2.0)); } function distance (a0, a1, b0, b1){ a0 = +a0; a1 = +a1; b0 = +b0; b1 = +b1; var dx = 0.0, dy = 0.0; dx = +a0 - +b0; dy = +a1 - +b1; return +sqrt(dx * dx + dy * dy); } return { cos: cos, sin: sin, distance: distance }; }(window));return H; }(HANNIBAL));From there one might call H.ASM.cos(1.234). I'll report back, when I got a speed test running in 0AD and get map data into this module.