Update simfunction.cpp