Length (Math.hypot) (v2)

Revision 2 of this benchmark created on


Setup

const xlen = 2/7
const ylen = 3/7
const zlen = 5/7
let result = 0

Test runner

Ready to run.

Testing in
TestOps/sec
Math.hypot
result = Math.hypot(xlen, ylen, zlen)
ready
JS impl (power op)
result = (xlen**2 + ylen**2 + zlen**2) ** 0.5
ready
JS impl (mul op)
result = (xlen*xlen + ylen*ylen + zlen*zlen) ** 0.5
ready
Math.sqrt (power op)
result = Math.sqrt(xlen**2 + ylen**2 + zlen**2)
ready
Math.sqrt (mul op)
result = Math.sqrt(xlen*xlen + ylen*ylen + zlen*zlen)
ready

Revisions

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