Accurate Goertzel Algorithm: Error Analysis, Validations and Applications
Abstract
:1. Introduction
- We design a new compensated Goertzel algorithm and prove that our algorithm can almost yield full working precision to evaluate polynomials (1);
- We propose dynamic error estimates, which can offer a sharper bound for our approach without considerably increasing its computing complexity;
- Numerical experiments show that our algorithm runs faster than the compensated Horner algorithm in some cases while keeping a similar precision accuracy;
- An application is given to illustrate that our algorithm outperforms MATLAB’s when dealing with the DFT.
2. Goertzel Compensated Algorithm
2.1. Goertzel Algorithm
Algorithm 1 Polynomial evaluation by Goertzel algorithm |
Function:
Require: , Ensure:
for end |
2.2. Error-Free Transformations and Sum of Squares Algorithm
Algorithm 2 Error-free transformation of the product of real and complex floating-point numbers |
Function:
Require: , Ensure: |
Algorithm 3 Sum of squares by two floating-point numbers |
Function: Require:
Ensure: |
2.3. Compensated Goertzel Algorithm
Algorithm 4 Polynomial evaluation by compensated Goertzel algorithm |
Function:
Require: , Ensure:
for end |
3. Round-Off Error and Complexity Analysis
3.1. Forward Round-Off Error Analysis
3.2. Running Round-Off Error Analysis
3.3. Computational Complexity
Algorithm 5 Polynomial evaluation by compensated Goertzel algorithm with a dynamic error estimate |
Function:
Require: , Ensure: , for end |
Algorithm 6 Polynomial evaluation by the Horner algorithm |
Function:
Require: , Ensure:
for end |
Algorithm 7 Polynomial evaluation by the compensated Horner algorithm |
Function:
Require: , Ensure: for end |
4. Numerical Experiments
4.1. Accuracy
4.2. Running Time
- Env1: Laptop with Intel Core i7-7700 CPU, 4 cores each at 3.6 GHz and with Microsoft Visual C++ 2012 with the default compiler option /od on Windows 7;
- Env2: Node of workstation with Intel Xeon E5-2697A CPU, 16 cores each at 2.6 GHz and with gcc 7.4.0 with the default compiler option-O0 on x86_64-Ubuntu-linux 18.04.
4.3. Application
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
DFT | discrete Fourier transform |
VS | Volk and Schumaker |
References
- Peña, J.M.; Sauer, T. On the multivariate Horner scheme. Siam J. Numer. Anal. 2000, 37, 1186–1197. [Google Scholar] [CrossRef]
- Gentleman, W.M. An error analysis of Goertzel’s (Watt’s) method for computing Fourier coefficients. Comput. J. 1969, 12, 160–165. [Google Scholar] [CrossRef]
- Newbery, A.C.R. Error analysis for Fourier series evaluation. Math. Comput. 1973, 27, 639–644. [Google Scholar] [CrossRef]
- Wilkinson, J.H. Rounding Errors in Algebraic Processes; Courier Corporation: Englewood Cliffs, NJ, USA, 1994. [Google Scholar]
- Smoktunowicz, A.; Wróbel, I. On improving the accuracy of Horner’s and Goertzel’s algorithms. Numer. Algorithms 2005, 38, 243–258. [Google Scholar] [CrossRef] [Green Version]
- Bailey, D.H. Library for Double-Double and Quad-Double Arithmetric. Available online: http://www.nersc.gov/dhbailey/mpdist/mpdist.html (accessed on 18 February 2021).
- Louvet, N. Compensated Algorithms in Floating-Point Arithmetic: Accuracy, Validation, Performances; Université de Perpignan Via Domitia: Perpignan, France, 2007. [Google Scholar]
- Langlois, P.; Louvet, N. More Instruction Level Parallelism Explains the Actual Efficiency of Compensated Algorithm; Technical Report hal-00165020; DALI Research Team, University of Perpignan: Perpignan, France, 2007. [Google Scholar]
- Ogita, T.; Rump, S.M.; Oishi, S. Accurate sum and dot product. Siam J. Sci. Comput. 2005, 26, 1955–1988. [Google Scholar] [CrossRef] [Green Version]
- Graillat, S.; Langlois, P.; Louvet, N. Algorithms for accurate, validated and fast polynomial evaluation. Jpn. J. Ind. Appl. Math. 2009, 26, 191–214. [Google Scholar] [CrossRef] [Green Version]
- Graillat, S.; Morain, V. Error-free transformations in real and complex floating-point arithmetic. In Proceedings of the International Symposium on Nonlinear Theory and Its Applications, Vancouver, BC, Canada, 16–19 September 2007; pp. 341–344. [Google Scholar]
- Graillat, S.; Morain, V. Accurate summation, dot product and polynomial evaluation in complex floating-point arithmetic. Inf. Comput. 2012, 216, 57–71. [Google Scholar] [CrossRef]
- Graillat, S. An accurate algorithm for evaluating rational functions. Appl. Math. Comput. 2018, 337, 494–503. [Google Scholar] [CrossRef] [Green Version]
- Cameron, T.; Graillat, S. On a Compensated Ehrlich-Aberth Method for the Accurate Computation of All Polynomial Roots. Available online: https://hal.archives-ouvertes.fr/hal-03335604 (accessed on 16 March 2021).
- Jiang, H.; Barrio, R.; Li, H.; Liao, X.; Cheng, L.; Su, F. Accurate evaluation of a polynomial in Chebyshev form. Appl. Math. Comput. 2011, 217, 9702–9716. [Google Scholar] [CrossRef]
- Jiang, H.; Li, S.; Cheng, L.; Su, F. Accurate evaluation of a polynomial and its derivative in Bernstein form. Comput. Math. Appl. 2010, 60, 744–755. [Google Scholar] [CrossRef] [Green Version]
- Delgado, J.; Peña, J.M. Algorithm 960: POLYNOMIAL: An Object-Oriented Matlab Library of Fast and Efficient Algorithms for Polynomials. ACM Trans. Math. Softw. 2016, 42, 1–19. [Google Scholar] [CrossRef]
- Kazal, N.Y.; Mukhlash, I.; Sanjoyo, B.A.; Hidayat, N.; Ozaki, K. Extended use of error-free transformation for real matrix multiplication to complex matrix multiplication. Siam J. Phys. Conf. Ser. 2021, 1821, 012022. [Google Scholar] [CrossRef]
- Ozaki, K. Error-free transformation of matrix multiplication for multi-precision computations. In Proceedings of the 19th International Symposium on Scientific Computing, Computer Arithmetic, and Verified Numerical Computations, Szeged, Hungary, 13–15 September 2021; Volume 33. [Google Scholar]
- Ozaki, K. An Error-Free Transformation for Matrix Multiplication with Reproducible Algorithms and Divide and Conquer Methods. J. Phys. Conf. Ser. 2020, 1490, 012062. [Google Scholar] [CrossRef]
- Ozaki, K.; Ogita, T. The Essentials of verified numerical computations, rounding error analyses, interval arithmetic, and error-free transformations. Nonlinear Theory Its Appl. 2020, 11, 279–302. [Google Scholar] [CrossRef]
- Blanchard, P.; Higham, D.J.; Higham, N.J. Accurately computing the log-sum-exp and softmax functions. IMA J. Numer. Anal. 2021, 41, 2311–2330. [Google Scholar] [CrossRef]
- Delgado, J.; Peña, J.M. Running relative error for the evaluation of polynomials. SIAM J. Sci. Comput. 2009, 31, 3905–3921. [Google Scholar] [CrossRef]
- Jiang, H.; Graillat, S.; Barrio, R.; Yang, C. Accurate, validated and fast evaluation of elementary symmetric functions and its application. Appl. Math. Comput. 2016, 273, 1160–1178. [Google Scholar] [CrossRef]
- Barrio, R.; Du, P.; Jiang, H.; Serrano, S. ORTHOPOLY: A library for accurate evaluation of series of classical orthogonal polynomials and their derivatives. Comput. Phys. Commun. 2018, 231, 146–162. [Google Scholar] [CrossRef]
- Croci, M.; Fasi, M.; Higham, N.J.; Mary, T.; Mikaitis, M. Stochastic rounding: Implementation, error analysis and applications. R. Soc. Open Sci. 2022, 9, 211631. [Google Scholar] [CrossRef]
- IEEE Standard 754-2008; Standard for Binary Floating Point Arithmetic. ANSI: New York, NY, USA, 2008.
- Clenshaw, C.W. A note on the summation of Chebyshev series. Math. Comput. 1955, 9, 118–120. [Google Scholar] [CrossRef] [Green Version]
- Szegö, G. Orthogonal Polynomials; American Mathematical Society: Providence, RI, USA, 1939. [Google Scholar]
- Knuth, D.E. The Art of Computer Programming: Seminumerical Algorithms, 3rd ed.; Addison-Wesley: Boston, MA, USA, 1998. [Google Scholar]
- Dekker, T.J. A floating-point technique for extending the available precision. Numer. Math. 1971, 18, 224–242. [Google Scholar] [CrossRef] [Green Version]
- Graillat, S.; Lauter, C.; Tang, P.T.; Yamanaka, N.; Oishi, S. Efficient Calculations of Faithfully Rounded I2-Norms of n-Vectors. ACM Trans. Math. Softw. 2015, 41, 1–20. [Google Scholar] [CrossRef] [Green Version]
- Higham, N.J. Accuracy and Stability of Numerical Algorithms, 2nd ed.; Society for Industrial and Applied Mathematics (SIAM): Philadelphia, PA, USA, 2002. [Google Scholar]
- Markstein, P. IA-64 and Elementary Functions: Speed and Precision; Prentice-Hall: Englewood Cliffs, NJ, USA, 2000. [Google Scholar]
- Nievergelt, Y. Scalar fused multiply-add instructions produce floating-point matrix arithmetic provably accurate to the penultimate digit. ACM Trans. Math. Softw. 2003, 29, 27–48. [Google Scholar] [CrossRef] [Green Version]
Algorithm | Properties | Flops |
---|---|---|
, | 6 | |
, | 17 | |
, | 34 | |
, | 12 | |
, | 80 |
Variates | Coefficients | |||||
---|---|---|---|---|---|---|
2N | 4N + 4 | 26N + 3 | 55N + 45 | 59N + 60 | ||
4N | 8N + 6 | 52N + 6 | 110N + 66 | 114N + 81 | ||
and | 7N − 4 | 4N + 7 | 90N + 6 | 55N + 91 | 59N + 106 | |
8N | 8N + 12 | 97N + 6 | 110N + 150 | 114N + 165 | ||
, and | 7N − 4 | 3N + 4 | 90N + 6 | 34N + 26 | 39N + 41 | |
8N | 6N + 9 | 97N + 6 | 68N + 90 | 72N + 105 |
Variates | |||||
---|---|---|---|---|---|
Theoretical | 13.75 | 2.12 | 1.07 | 2.27 | |
Evn1 | 9.15 | 1.42 | 1.13 | 1.59 | |
Evn2 | 2.76 | 1.35 | 1.11 | 1.49 | |
Theoretical | 13.75 | 61.14% | 1.07 | 65.59% | |
and | Evn1 | 9.29 | 64.19% | 1.13 | 72.22% |
Evn2 | 2.81 | 67.71% | 1.1 | 74.14% | |
Theoretical | 11.33 | 37.79% | 1.15 | 43.35% | |
, and | Evn1 | 6.53 | 44.09% | 1.1 | 48.43% |
Evn2 | 2.22 | 53.66% | 1.09 | 58.38% |
Variates | |||||
---|---|---|---|---|---|
Theoretical | 13.75 | 2.12 | 1.04 | 2.19 | |
Evn1 | 10.32 | 1.24 | 1.17 | 1.46 | |
Evn2 | 4.8 | 1.16 | 1.35 | 1.57 | |
Theoretical | 13.75 | 1.13 | 1.04 | 1.18 | |
and | Evn1 | 10.37 | 1.25 | 1.19 | 1.48 |
Evn2 | 4.8 | 1.17 | 1.35 | 1.58 | |
Theoretical | 11.33 | 70.13% | 1.06 | 74.26% | |
, and | Evn1 | 7.21 | 84.61% | 1.17 | 98.54% |
Evn2 | 3.67 | 89.22% | 1.33 | 1.18 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Li, C.; Du, P.; Li, K.; Liu, Y.; Jiang, H.; Quan, Z. Accurate Goertzel Algorithm: Error Analysis, Validations and Applications. Mathematics 2022, 10, 1788. https://doi.org/10.3390/math10111788
Li C, Du P, Li K, Liu Y, Jiang H, Quan Z. Accurate Goertzel Algorithm: Error Analysis, Validations and Applications. Mathematics. 2022; 10(11):1788. https://doi.org/10.3390/math10111788
Chicago/Turabian StyleLi, Chuanying, Peibing Du, Kuan Li, Yu Liu, Hao Jiang, and Zhe Quan. 2022. "Accurate Goertzel Algorithm: Error Analysis, Validations and Applications" Mathematics 10, no. 11: 1788. https://doi.org/10.3390/math10111788
APA StyleLi, C., Du, P., Li, K., Liu, Y., Jiang, H., & Quan, Z. (2022). Accurate Goertzel Algorithm: Error Analysis, Validations and Applications. Mathematics, 10(11), 1788. https://doi.org/10.3390/math10111788