clean up bernoulli.h: use prefix for helper functions to avoid potential naming conflicts