Dual Numbers for Algorithmic Differentiation

  • Francisco Ramón Peñuñuri Anguiano Facultad de Ingeniería de la Universidad Autónoma de Yucatán
  • Osvaldo Carvente
  • Miguel Zambrano
  • Ricardo Peón
  • Carlos Cruz


The cubic spline interpolation method, the Runge–Kutta method, and the Newton–Raphson method are extended to dual versions (developed in the context of dual numbers). This extension allows the calculation of the derivatives of complicated compositions of functions which are not necessarily defined by a closed form expression. The code for the algorithms has been written in Matlab and some examples are presented. Among them, we use the dual Newton–Raphson method to obtain the derivatives of the output angle in the RRRCR spatial mechanism; we use the dual normal cubic spline interpolation algorithm to obtain the thermal diffusivity using photothermal techniques; and we use the dual Runge–Kutta method to obtain the derivatives of functions depending on the solution of the Duffing equation.


[1] W. Clifford, Preliminary sketch of biquaternions, Proc. London Mathematical Society 1 (1-4) (1873) 381–395.

[2] E. Pennestr`ı, R. Stefanelli, Linear algebra and numerical algorithms using dual numbers, Multibody System Dynamics 18 (2007) 323–344.

[3] H. Leuck, H.-H. Nagel, Automatic differentiation facilitates of-integration into steering-angle-based road vehicle tracking, IEEE Computer Society Conference on Computer Vision and Pattern Recognition 2 (5) (1999) 2360.

[4] D. Piponi, Automatic differentiation, C++ templates, and photogrammetry, Journal of Graphics, GPU, and Game Tools 9 (4) (2004) 41–55.

[5] J. A. Fike, J. J. Alonso (Eds.), The Development of Hyper-Dual Numbers for Exact Second-Derivative Calcu- lations, Proceedings of the 49th AIAA Aerospace Sciences Meeting, Orlando FL, USA, 2011.

[6] W. Yu, M. Blair, DNAD, a simple tool for automatic differentiation of Fortran codes using dual numbers, Computer Physics Communications 184 (2013) 1446–1452.

[7] J. N. Lyness, C. B. Moler, Numerical differentiation of analytic functions, SIAM Journal on Numerical Analysis 4 (1967) 202–210.

[8] R. E. Rowlands, T. Liber, I. M. Daniel, P. G. Rose, Higher-order numerical differentiation of experimental information, Experimental Mechanics 13 (1973) 105–112.

[9] A. Griewank, On automatic differentiation, in Mathematical Programming: Recent Developments and Appli- cations, M. Iri and K. Tanabe, eds., Kluwer, Dordrecht, The Netherlands, 1998.

[10] I. Knowles, R. Wallace, New finite difference formulas for numerical differentiation, Numerische Mathematik 70 (1995) 91–110.

[11] I. Khan, R. Ohba, Closed-form expressions for the finite difference approximations of first and higher derivatives based on Taylor series, Journal of Computational and Applied Mathematics 107 (1999) 179–193.

[12] I. Khan, R. Ohba, New finite difference formulas for numerical differentiation, Journal of Computational and Applied Mathematics 126 (2001) 269–276.

[13] J. Li, General explicit difference formulas for numerical differentiation, Journal of Computational and Applied Mathematics 183 (2005) 29–52.

[14] Z. Qian, C.-L. Fu, X.-T. Xiong, T. Wei, Fourier truncation method for high order numerical derivatives, Applied Mathematics and Computation 181 (2006) 940–948.

[15] K. Ahnert, M. Abel, Numerical differentiation of experimental data: Local versus global methods, Computer Physics Communications 177 (2007) 764–774.

[16] A. K. Singh, B. S. Bhadauria, Finite difference formulae for unequal sub-intervals using Lagranges interpolation formula, International Journal of Mathematical Analysis 3 (2009) 815–827.

[17] Z. Wang, R. Wen, Numerical differentiation for high orders by an integration method, Journal of Computational and Applied Mathematics 234 (2010) 941–948.

[18] F.-F. Dou, C.-L. Fu, Y.-J. Ma, A wavelet-Galerkin method for high order numerical differentiation, Applied Mathematics and Computation 215 (2010) 3702–3712.

[19] R. D. Neidinger, Introduction to automatic differentiation and MATLAB object-oriented programming, SIAM Review 52 (3) (2010) 545–563.

[20] M. Ramachandran, Fast derivative computation using smooth X-splines, Applied Numerical Mathematics 62 (2012) 1654–1662.

[21] V. I. Dmitriev, Z. G. Ingtem, Numerical differentiation using spline functions, Computational Mathematics and Modeling 23 (2012) 179–193.

[22] H. Hassan, A. Mohamad, G. Atteia, An algorithm for the finite difference approximation of derivatives with arbitrary degree and order of accuracy, Journal of Computational and Applied Mathematics 236 (2012) 2622– 2631.

[23] A. Griewank, A. Walther, Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation, Society for Industrial Mathematics, 2008.

[24] M. Depriester, P. Hus, S. Delenclos, A. H. Sahraoui, New methodology for thermal parameter measurements in solids using photothermal radiometry, Review of Scientific Instruments 76 (2005) 074902–1–074902–6.

[25] S. Wiggins, Introduction to Applied Nonlinear Dynamical Systems and Chaos, Springer-Verlag, New York, 1990.

[26] H. Nijmeijer, H. Berghuis, On Lyapunov control of the Duffing equation, IEEE Transactions on Circuits and Systems–I (42) (1995) 473–477.

[27] El ̧cin Yusufoˇglu, Numerical solution of Duffing equation by the Laplace decomposition algorithm, Applied Mathematics and Computation (177) (2006) 572–580.

[28] J. J. Cervantes-S ́anchez, J. M. Rico-Mart ́ınez, V. H. P ́erez-Mun ̃oz, A. Bitangilagy, Function generation with the RRRCR spatial linkage, Mechanism and Machine Theory 74 (2014) 58–81.

[29] F. Peñuuñuuri, O. Carvente, M. Zambrano-Arjona, R. Pe ́on, C. A. Cruz-Villar, Matlab class for dual numbers, http://algorithmic-differentiation.frp707.esy.es/.

[30] Y.-L. Gu, J. Y. S. Luh, Dual-number transformation and its applications to robotics, IEEE Journal of Robotics and Automation 3 (6) (1987) 615–623.

[31] H. H. Cheng, Programming with dual numbers and its applications in mechanisms design, Engineering with Computers 10 (4) (1994) 212–229.

[32] N. J. Higham, Functions of Matrices: Theory and Computation, Society for Industrial and Applied Mathe- matics, Philadelphia, PA, USA, 2008.

[33] S. Hassani, Mathematical Physics. A modern Introduction to its Foundations, Springer, New York, 2000.

[34] W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery, Numerical Recipes in Fortran 77 The Art of Scientific Computing, 2nd Edition, Vol. 1, Cambridge Univerity Press, 1995.

[35] H. Cohen, Numerical Approximation Methods, Springer-Verlag, New York, 2010.

[36] H. Susanto, N. Karjanto, Newtons methods basins of attraction revisited, Applied Mathematics and Compu- tation 215 (2009) 1084–1090.

[37] W. Gander, On Halley’s iteration method, The American Mathematical Monthly 92 (1985) 131–134.

[38] R. H. Bartels, J. C. Beatty, B. A. Barsky, An Introduction to Splines for Use in Computer Graphics and Geometric Modeling, Morgan Kaufmann, Los Altos, CA, 1987.

[39] R. A. Usmani, Inversion of a tridiagonal jacobi matrix, Linear Algebra and its Applications 212213 (0) (1994) 413 – 414.

[40] D. F. Griffiths, D. J. Higham, Numerical Method for Ordinary Differential Equations, Springer, London, 2010.

[41] P. Uwer, Easyndata: A simple tool to extract numerical values from published plots, arXiv: 0710.2896v1 [physics.comp-ph].

[42] A. L. Edwards, A compilation of thermal property data for computer heat-conduction calculations, UCRL- 50589, University of California Lawrence Radiation Laboratory, 1969.
Artículos de Investigación