Numerical computation of singular minimizers involving the Lavrentiev phenomenon