Szabolcs Horvát

MENU
  • About
  • Publications
  • Software
  • Photos
  • Links
  • Notes

Fast computation of integer powers

Fri 17 February 2017
By szhorvat

In Notes.

tags: tipsprogramming

Introduction

How many multiplications are needed to calculate \(x^6\)? The naïve way to do it is \(x^6 = x\cdot x\cdot x\cdot x\cdot x\cdot x\). That is five multiplications. But we can do better: \((x\cdot x\cdot x)^2\) only requires three. Using as …

read more ...

There are comments.