Multicomplex number class for Matlab, with a focus on the accurate calculation of small imaginary terms for multicomplex step sensitivity calculations - Varas,Casado JM; Hewson,R (ACM Transactions on Mathematical Software, 2020)
A Matlab class for multicomplex numbers was developed with particular attention paid to the robust and accurate handling of smallimaginary components. This is primarily to allow the class to be used to obtainn-order derivative information using the multicomplexstep method for, amongst other applications, gradient-based optimization and optimum control problems. The algebra of multicomplexnumbers is described as is its accurate computational implementation, considering small term approximations and the identification ofprinciple values. The implementation of the method in Matlab is studied, and a class definition is constructed. This new class definitionenables Matlab to handlen-order multicomplex numbers, and perform arithmetic functions. It was found that with this method, thestep size could be arbitrarily decreased toward machine precision. Use of the method to obtain up to the 7th derivative of functions ispresented, as is timing data to demonstrate the efficiency of the class implementation.