Show HN: Compute polynomials twice as fast

94 points - yesterday at 8:53 AM


A few years ago my coauthor and I was wondering if we could reduce the number of multiplications used for hashing algorithms. We had a construction and a 100 page proof, but we were not 100% sure it was correct. Now we have a full Lean proof, so we decided to publish it.

I made this website to make it easy for anyone how has polynomials to evaluate to see how it would be done using our method, as well as a number of previous approaches by Knuth and others.

Source

Comments

emil-lp today at 8:31 AM
I read your arxiv paper yesterday (or was it the day before).

Do you think this can be used to speed up the algebraic method for k-path?

If so, you should enter next years PACE challenge.

huhtenberg today at 10:12 AM
* "monic" = the leading coefficient is 1
pvillano today at 6:25 AM
This is super cool. I learned a lot playing with the demo. I only knew Horner and Estrin, but I think I've gotten a grasp on most of them.

One small change I'd recommend is for the graph visualization, have a separate source node for each x, x^2, x^4 used. A single x source clutters the graph and hides the structure.

IsTom today at 9:21 AM
Pretty cool, especially in finite fields. Though coefficients seem to blow up pretty quick in Q?
throwaway81523 today at 6:14 AM
If you're going to preprocess the polynomial, maybe you want to evaluate it at many different points. But then why not use the FFT?
voxelghost today at 2:30 AM
It keeps flipping back to 'monic' from e.g. 'ln(1+x)' when switching between algorithms, and then seems to lock to 'monic'? (Am I missing something?)

Also I am curious, in your version vs. horner , how do both algorithms map onto number of fmadd operations?

deleted yesterday at 9:18 AM
vlovich123 today at 2:30 AM
Would this be applicable to fast hashes like WyHash and xxh3 or are those not using polynomials? Is this mainly for faster cryptographic hashes?
thomasahle today at 6:32 AM
See also discussions here https://www.reddit.com/r/programming/comments/1wbgcke/commen... on how the actual math works out.
aetherspawn today at 2:18 AM
I guess it’s not faster than using a table for CRC8?
gowld today at 2:37 AM
From the abstract, a name that many on HN would recognize:

> We also give an injective polynomial construction for universal hashing that uses N multiplications to hash 2N values with a single random key. This improves the best previous construction by Daniel J. Bernstein (this http URL).

gowld today at 2:33 AM
What is the tradeoff between multiplication and addition?
devenquan today at 9:45 AM
[flagged]