bernstein function

Fit a Bernstein polynomial approximation.