fixed global variable reference in uniform sampler
very small negative phase certificates occasionally happen; printing when there's a problem
adding a script which fits the cost of the random optimal matching to the sum of linear and sqrt terms