new implementation of the analytic solution in C