writing a general purpose solver for the error of replica equations