As noted in
https://github.com/privacy-scaling-explorations/halo2/issues/151 the
generation of a random poly for degrees bigger than 20 starts to get
quite slow.
This PR tries to include some minimal changes in the `commit` fn so that
we upstream the improvements achieved in PSE/halo2
The existing code will fold together a very deep AST that applies Horner's
rule to each gate in a proof -- which could include multiple circuits and
so for some applications will quickly grow such that when we recursively
descend later during evaluation the stack will easily overflow.
This change special cases the application of Horner's rule to a
"DistributePowers" AST node to keep the tree depth from exploding in size.