Below is a simple piece of process coded in C#
and Python
respectively (for those of you curious about the process, it\'s the solution for Problem
Python (and all scripting languages including matlab) is not intended to be directedly used for large-scale numerical calculation. To have a compatible result as complied programs, avoid the loops at all cost and convert the formula to matrix formats (that needs a little mathematical understanding and skill), so that we can push as much as possible to the background C library provided by numpy, scipy, etc.
Again, DO NOT write loops for numerical calculation in python, whenever a matrix equivalent possible!