High-performance implementation of exponential functions for RISC-V processors
Authors
-
Elena A. Panova
-
Valentin D. Volokitin
-
Evgeny A. Kozinov
-
Iosif B. Meyerov
Keywords:
mathematical functions
exponent function
exp
exp2
expm1
vector calculations
high-performance calculations
RISC-V architecture
Abstract
The development of a high-performance vector library for standard mathematical functions represents a significant objective for the advancement of HPC on platforms based on the RISC-V architecture. This paper presents a detailed implementation of the exp, exp2, and expm1 functions for double-precision, single-precision, and half-precision floating-point types. Special attention is paid to aspects of computational accuracy and performance. A detailed comparison with other existing vector math libraries for the RISC-V architecture is provided.
Section
Parallel software tools and technologies
References
- J.-M. Muller, “Elementary functions and approximate computing,” Proceedings of the IEEE. 108 (12), 2136–2149 (2020).
doi 10.1109/JPROC.2020.2991885
- W. Liu, F. Lombardi, and M. Shulte, “A Retrospective and Prospective View of Approximate Computing [Point of View,” Proceedings of the IEEE. 108 (3), 394–399 (2020).
doi 10.1109/JPROC.2020.2975695
- J. E. Volder, “The CORDIC trigonometric computing technique,” IRE Transactions on electronic computers. EC-8 (3), 330–334 (1959).
doi 10.1109/TEC.1959.5222693
- E. Remes, “Sur un procédé convergent d’approximations successives pour déterminer les polynômes d’approximation,” Comptes rendus de l’Académie des Sciences. 198, 2063–2065 (1934).
- N. Brisebarre, S. Chevillard, “Efficient polynomial L^infty-approximations,” in 18th IEEE Symposium on Computer Arithmetic (ARITH ’07), Jun 2007, Montpellier, France(IEEE, 2007), 169–176.
doi 10.1109/ARITH.2007.17
- Jr. Thacher, C. Henry, “Software Manual for the Elementary Functions (W. J. Cody, Jr. and W. Waite),” SIAM Rev. 24 (1), 91–93 (1982).
doi 10.1137/1024023
- P. Kornerup, J.-M. Muller, “Extending the Range of the Cody and Waite Range Reduction Method,” 2005,
https://www.academia.edu/62418560/Extending_the_Range_of_the_Cody_and_Waite_Range_Reduction_Method Cited January 21, 2026.
- P.-T. P. Tang, “Table-driven implementation of the exponential function in IEEE floating-point arithmetic,” ACM Transactions on Mathematical Software (TOMS). 15 (2), 144–157 (1989).
doi 10.1145/63522.214389
- P.-T. P. Tang, “Table-driven implementation of the logarithm function in IEEE floating-point arithmetic,” ACM Transactions on Mathematical Software (TOMS). 16 (4), 378–400 (1990).
doi 10.1145/98267.98294
- J.-M. Muller, Elementary functions: Algorithms and Implementation. 3rd Edition(Birkhäuser Boston, MA, 2016).
doi 10.1007/978-1-4899-7983-4
- N. Brisebarre, G. Hanrot, J.-M. Muller, et al., “Correctly-Rounded Evaluation of a Function: Why, How, and at What Cost?’’ACM Computing Surveys. 58 (1), 1–34 (2025).
doi 10.1145/3747840
- The GNU MPFR Library.
https://www.mpfr.org/ Cited January 21, 2026.
- C. Daramy, D. Defour, F. de Dinechin, and J.-M. Muller, “CR-LIBM: a correctly rounded elementary function library,” inProc. SPIE 5205, Advanced Signal Processing Algorithms, Architectures, and Implementations XIII(SPIE, 2003), 5205, 458–464.
doi 10.1117/12.505591
- SLEEF Vectorized Math Library.
https://sleef.org/ Cited January 21, 2026.
- GitHub - rvvpl/rvvmf.
https://github.com/rvvpl/rvvmf Cited January 21, 2026.
- P.-T. P. Tang, “An Open-Source RISC-V Vector Math Library,” in 2024 IEEE 31st Symposium on Computer Arithmetic (ARITH), Malaga, Spain, June 10–12, 2024(IEEE, 2024), pp. 60–67.
doi 10.1109/ARITH61463.2024.00019
- GitHub - rivosinc/veclibm: Vector math library using RISC-V vector ISA via C intrinsic.
https://github.com/rivosinc/veclibm Cited January 22, 2025.
- E. A. Panova, V. D. Volokitin, E. A. Kozinov, and I. B. Meyerov, “High-performance implementation of exp and expm1 functions for RISC-V processors,” in Proc. Int. Conf. on Russian Supercomputing Days, Moscow, Russia, September 29–30, 2025, (MAX Press, Moscow, 2025), pp. 67–84. [in Russian].
- J.-M. Muller, On the definition of ulp(x): research report / Thème SYM – Systèmes symboliques, Projet Arénaire. Rapport de recherche n° 5504, 2005Institut National de Recherche en Informatique et en Automatique (INRIA), 2005.
https://www.academia.edu/62418489/On_the_definition_of_ulp_x_ Cited January 22, 2025.
- The GNU C Library - GNU Project - Free Software Foundation (FSF).
https://www.gnu.org/software/libc/manual/html_node/index.html Cited January 22, 2025.
- B. Gladman, V. Innocente, J. Mather, and P Zimmermann, Accuracy of Mathematical Functions in Single, Double, Double Extended, and Quadruple Precision, HAL preprint, 2025,
https://inria.hal.science/hal-03141101v8 Cited January 22, 2025.
- Sollya software tool.
https://www.sollya.org/ Cited January 22, 2025.
- G. Estrin, “Organization of computer systems: the fixed plus variable structure computer,” in Papers presented at the May 3–5, 1960, western joint IRE-AIEE-ACM computer conference, May 3–5, 1960, San Francisco, California, USA(ACM, New York, NY, USA, 1960), 33–40.
doi 10.1145/1460361.1460365
- T. J. Dekker, “A floating-point technique for extending the available precision,” Numerische Mathematik. 18 (3), 224–242 (1971).
doi 10.1007/BF01397083
- C. Daramy, D. Defour, F. de Dinechin, and J.-M. Muller, CR-LIBM: The evaluation of theexponential: research report / LIP RR–2003–37 Laboratoire de l’informatique du parallélisme, 2003, HAL preprint, 2+37 p.
https://hal-lara.archives-ouvertes.fr/hal-02102084/ Cited January 22, 2025.
- S. Linnainmaa, “Software for doubled-precision floating-point computations,” ACM Transactions on Mathematical Software (TOMS). 7 (3), 272–283 (1981).
doi 10.1145/355958.355960
- V. Lefevre, J.-M. Muller, and A. Tisserand, “Toward correctly rounded transcendentals,” IEEE Transactions on Computers. 47 (11), 1235–1243 (1998).
doi 10.1109/12.736435
- A. Ziv, “Fast evaluation of elementary mathematical functions with correctly rounded last bit,” ACM Transactions on Mathematical Software (TOMS). 17 (3), 410–423 (1991).
doi 10.1145/114697.116813
- P.-T. P. Tang, “Table-driven implementation of the Expm1 function in IEEE floating-point arithmetic,” ACM Transactions on Mathematical Software (TOMS). 18 (2), 211–222 (1992).
doi 10.1145/146847.146928
- V. D. Volokitin, E. P. Vasiliev, E. A. Kozinov, et al., “Improved Vectorization of OpenCV Algorithms for RISC-V CPUs,” Lobachevskii J. Math. 45 (1), 130–142 (2024).
doi 10.1134/S1995080224010530
- A. Pirova, A. Vodeneeva, K. Kovalev, et al., “Performance optimization of BLAS algorithms with band matrices for RISC-V processors,” Future Generation Computer Systems. 174, Article No. 107936 (2025).
doi 10.1016/j.future.2025.107936