C code with the new version of the analytic solution by mark