triangle function test

Benchmark publishedon

Setup

const testcase = new Array(100).fill(0).map(v => Math.random() * Math.PI * 2);
let outputs = [];

Teardown

outputs = null;

Test Runner

Initializing...

Testing in
Test CaseOps/sec
sin
for(const rad of testcase) {
	const radCos = Math.cos(rad);
	const radSin = Math.sin(rad);
	outputs.push([radCos, radSin]);
}
ready
1 - cos^2
for(const rad of testcase) {
	const radCos = Math.cos(rad);
	const radSin = Math.sqrt(1 - Math.pow(radCos, 2));
	outputs.push([radCos, radSin]);
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

Revision 1
publishedon