Balanced Binary Tree Schemes for Computing Zernike Radial Polynomials
Hong-Yan Zhang, Yu Zhou, Zhi-Qiang Feng
TL;DR
This work addresses the stable and fast computation of Zernike radial polynomials $R_n^m(\rho)$ on the unit disk, avoiding factorial overflow and instability in traditional approaches. It introduces a balanced binary tree (BBT) structure, deriving a novel recursive formula and two schemes: a recursive BBTRA and an iterative BBTIA, with rigorous complexity analyses. BBTRA exhibits exponential time/space in the index difference $n-m$, while BBTIA achieves a practical quadratic time and linear space, suitable for real-time applications, as validated by microsecond-scale runtimes on multiple platforms. The authors also provide code and data publicly, highlighting educational value and the discrete-mathematics beauty underlying engineering problems.
Abstract
Zernike radial polynomials (ZRP) play a significant role in application areas such as optics design, imaging systems, and image processing systems. Currently, there are two kinds of numerical schemes for computing the ZRP automatically with computer programs: one is based on the definition in which the factorial operations may lead to the overflow problem and the high order derivatives are troublesome, and the other is based on recursion which is either unstable or with high computational complexity. In this paper, our emphasis is focused on exploring the balanced binary tree (BBT) schemes for computing the ZRP: firstly an elegant formulae for computation is established; secondly the recursive and iterative algorithms based-on BBT are proposed; thirdly the computational complexity of the algorithms are analyzed rigorously; finally the performance of BBT schemes by testing the running time is verified and validated. Theoretical analysis shows that the computational complexity of balanced binary tree recursive algorithm (BBRTA) and iterative algorithm are exponential and quadratic respectively, which coincides with the running time test very well. Experiments show that the time consumption is about $1\sim 10$ microseconds with different computation platforms for the balanced binary tree iterative algorithm (BBTIA), which is stable and efficient for real-time applications. In the sense of STEM education, the connection of the BBT and ZRP exhibits the beauty and applications of discrete mathematical structure behind the engineering problem, which is worthy of introducing to the college students, computer programmers and optics engineers.
