Using explicit expressions for analytical derivatives often results in much faster code than using symbolic math. However, coding expressions for analytical derivatives is sometimes an error-prone process.
This tool makes it easy to test analytical derivatives up to order three against numerical derivatives, for functions of one or two variables.
Are Mjaavatten (2020). test_derivatives (https://www.mathworks.com/matlabcentral/fileexchange/74031-test_derivatives), MATLAB Central File Exchange. Retrieved .
Somewhat more versatile version.