Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0
Firefox 109
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
phi = Math.pow(5, 0.5) * 0.5 + 0.5; 497093824.0 Ops/sec
phi = Math.phi 528124992.0 Ops/sec
phi = (Math.sqrt(5) + 1) / 2; 524022688.0 Ops/sec
phi = (Math.sqrt(5) + 1) * 0.5 516926752.0 Ops/sec
phi = 5 ** 0.5 * 0.5 + 0.5 522192512.0 Ops/sec
Script Preparation code:
Tests:
  • phi = Math.pow(5, 0.5) * 0.5 + 0.5;

  • phi = Math.phi

  • phi = (Math.sqrt(5) + 1) / 2;

  • phi = (Math.sqrt(5) + 1) * 0.5

  • phi = 5 ** 0.5 * 0.5 + 0.5