Extract the gamma table generation into a public generate_gamma_table() function and add unit tests covering table properties and the zero_means_zero regression from #15055.