Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Firefox/92.0
Firefox 92
Mac OS X 10.15
Desktop
2 years ago
Test name Executions per second
phi = Math.pow(5, 0.5) * 0.5 + 0.5; 628161920.0 Ops/sec
phi = Math.phi 619901440.0 Ops/sec
phi = (Math.sqrt(5) + 1) / 2; 614963520.0 Ops/sec
phi = (Math.sqrt(5) + 1) * 0.5 617854464.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