logoalt Hacker News

moi2388last Sunday at 12:52 PM1 replyview on HN

For large numbers, operations like addition don’t matter? Only multiplication? And now we want to find the fewest amount of multiplications?

Okay. No problem.

(ad + bc) = d + d .. + d + c + c .. + c

There we go, zero multiplications.


Replies

entropelast Sunday at 1:42 PM

The article is explicit that addition is O(n), with n digits, which is cheaper than multiplication is believed to be. Naive multiplication is O(n*n) -- considerably less than your algorithm.

show 1 reply