trigetry
Date tested:
6 years ago
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3321.0 Safari/537.36
Test name
Executions per second
q
3782302.0 Ops/sec
native
1606960.6 Ops/sec
Benchmark definition (click to collapse):
Script Preparation code:
function sines(x) { if (x < -3.14159265) x += 6.28318531; else if (x > 3.14159265) x -= 6.28318531; if (x < 0) return 1.27323954 * x + .405284735 * x * x; else return 1.27323954 * x - 0.405284735 * x * x; } function coses(x) { x += 1.57079632; if (x > 3.14159265) x -= 6.28318531; if (x < 0) return 1.27323954 * x + 0.405284735 * x * x else return 1.27323954 * x - 0.405284735 * x * x; }
Tests:
q
sines(10); coses(10);
native
Math.sin(10); Math.cos(10);
Open this result on MeasureThat.net