new file:   precompute_local.cpp