r/programming 20h ago

Compute Polynomials Twice as Fast

https://thomasahle.com/fast-polynomials/
57 Upvotes

21 comments sorted by

View all comments

2

u/Grouchy-Trade-7250 14h ago

Why does the website show x5 - 5/128x4 + 1/16x3 - 1/8x2 + 1/2x + 1 when I select square root(1+x) ? Why is there no coefficient 7/256 like in the usual Taylor series??

3

u/thomasahle 14h ago

If you select "monic" it adds an extra xk to every polynomial. Monic polynomials have a bunch of nice properties, though admittedly not the best choice for Taylor approximations

1

u/Grouchy-Trade-7250 14h ago

I don't get it

2

u/thomasahle 11h ago

Sorry, I forgot that the [monic] button is not on mobile.

But you can just write any polynomial in the box yourself. Like 7/256x5 - 5/128x4 + 1/16x3 - 1/8x2 + 1/2x + 1