This video covers it well: https://youtu.be/h7apO7q16V0
Also, chapter 30 of CLRS: https://elec3004.uqcloud.net/ebooks/CLRS%20(2nd%20Ed)%20-%20...
This video covers it well: https://youtu.be/h7apO7q16V0
Also, chapter 30 of CLRS: https://elec3004.uqcloud.net/ebooks/CLRS%20(2nd%20Ed)%20-%20...
sidenote: polynomial multiplication != interpolation
I've benchmarked FFT/non-FFT based approaches for almost everything in that scale for the last ten years and gotten quite different results.
Edit, see for example: https://www.zprize.io/prizes/accelerating-ntt-operations-on-...
https://en.wikipedia.org/wiki/Introduction_to_Algorithms
And CLR (in a sibling comment) refers to the 1990 first edition.
Calculate the left Product(0..i-1) of each term in left-to-right order, and the Product(i+1..N-1) of each term in right-to-left order. Your mileage may vary on a GPU.
Build a table left[j] of product-of-ratios for i < j, and another right[k] for i > k, each in linear-time, and combine the two to find the product-of-ratio for i != m in linear time as well.
What do you mean by left product and right product?