v1
1/31/2020 by arccoza 1/31/202000
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
const m = 0x5F375A86,
  // Creating the buffer and view outside the function
  // for performance, but this is not thread safe.
  buffer = new ArrayBuffer(4),
  view = new DataView(buffer)

function fastInvSqrt (n) {
  var f, n2 = n * 0.5, th = 1.5
  view.setFloat32(0, n)
  view.setUint32(0, m - (view.getUint32(0) >> 1))
  f = view.getFloat32(0)
  f *= (th - (n2 * f * f))
  f *= (th - (n2 * f * f))
  return f
}

function invSqrt(n) {
  return 1 / Math.sqrt(n)
}
delete caserun single casemove downdrag and drop case


ready



invSqrt(1.6)
delete caserun single casemove updrag and drop case


ready



fastInvSqrt(1.6)
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN