Skip to main content
Log in

Design of variable precision transcendental function automatic generator

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

The performance of transcendental functions is important to high-performance applications. Various customized implementations of transcendental functions in practice to obtain better performance for some particular applications, but specializing the transcendental functions for each individual application cannot scale with the increase and diversity of the latter. It is thus of vital importance to design and implement an automatic generator for transcendental functions. This article implements an automatic generator TGen (transcendental function generator) for variable precision transcendental functions. Given a specific computation interval, TGen can automatically generate independent implementations with different precisions for a transcendental function, and select the most suitable version for the target by means of a code filtering strategy. Our generator can now support the automatic generation of 18 representative transcendental functions. The experimental results show that TGen can generate code with the unfixed accuracy, and the performance of the generated code is superior to that of the code generated by metalibm. More specifically, when compiled with the GCC compiler, the code generated by TGen can provide a mean speedup of 1.84\(\times\) over that of a metalibm’s version, while the speedup of TGen’s code over that of the metalibm is 1.27\(\times\) when compiled with the SW5CC compiler.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6

Similar content being viewed by others

Notes

  1. https://www.gnu.org/software/libc/.

  2. https://software.intel.com/content/www/us/en/develop/articles/intel-math-kernel-library-intel-mkl-2020-system-requirements.html.

  3. http://www.netlib.org/fdlibm/.

References

  1. Muller JM (2020) Elementary functions and approximate computing. Proc IEEE 108(12):2136–2149. https://doi.org/10.1109/JPROC.2020.2991885

    Article  Google Scholar 

  2. Xu JC , Guo SZ, WANG L (2012) Optimization technology in simd mathematical functions based on vector register reuse. In: 2012 IEEE 14th International Conference on High Performance Computing and Communication & 2012 IEEE 9th International Conference on Embedded Software and Systems, pp 1102–1107. https://doi.org/10.1109/HPCC.2012.161

  3. Franchetti F, Low TM, Popovici DT, et al (2018) SPIRAL: extreme performance portability. In: IEEE special issue on From High Level Specification to High Performance Code 2018, vol 106, pp 1935–1968. https://doi.org/10.1109/JPROC.2018.2873289

  4. Muller JM (2016) Elementary functions, algorithms and implementation, 3rd edn. Birkhäuser, Boston. https://doi.org/10.1007/978-1-4899-7983-4

    Book  MATH  Google Scholar 

  5. Saint-Geniès HDL (2018) Elementary functions: towards automatically generated, efficient, and vectorizable implementations. Université de Perpignan. https://tel.archives-ouvertes.fr/tel-01841424/document

  6. Mouilleron C, Revy G (2011) Automatic generation of fast and certified code for polynomial evaluation. In: Proceedings of the 2011 IEEE 20th Symposium on Computer Arithmetic, pp 233–242. https://doi.org/10.1109/ARITH.2011.39.

  7. Mouilleron C, Najahi MA, Revy G (2014) Automated synthesis of target-dependent programs for polynomial evaluation in fixed-point arithmetic. In: SYNASC: Symposium on Symbolic and Numeric Algorithms for Scientific Computing, Timisoara, Romania, pp 141–148. https://doi.org/10.1109/SYNASC.2014.27

  8. Brunie N, Lauter C, Revy G (2019) Precision adaptation for fast and accurate polynomial evaluation generation. In: 2019 IEEE 30th International Conference on Application-specific Systems, Architectures and Processors (ASAP), vol 2160-052X, pp 41-41. https://doi.org/10.1109/ASAP.2019.00-32

  9. Ewart T, Cremonesi F, Schürmann F, Delalondre F (2020) Polynomial evaluation on superscalar architecture, applied to the elementary function \(e^x\). ACM Trans Math Softw 46(3), 28. https://doi.org/10.1145/3408893

  10. Saint-Geniès HDL, Defour D, Revy G (2017) Exact lookup tables for the evaluation of trigonometric and hyperbolic functions. IEEE Trans Comput 66(12):2058–2071. https://doi.org/10.1109/TC.2017.2703870

    Article  MathSciNet  MATH  Google Scholar 

  11. Volkova A, Muller JM (2019) Semi-automatic implementation of the complementary error function. In: ARITH 2019—26th IEEE Symposium on Computer Arithmetic, pp 1–8

  12. Lim JP, Aanjaneya M, Gustafson J, Nagarakatte S (2021) An approach to generate correctly rounded math libraries for new floating point variants. Proc ACM Program Lang 5:1–30. https://doi.org/10.5281/zenodo.4067194

    Article  Google Scholar 

  13. Chevillard S, Joldes M, Lauter C (2010) Sollya: an environment for the development of numerical codes. In: ICMS’10 Proceedings of the Third International Congress Conference on Mathematical Software. vol 6327, pp 28–31. https://doi.org/10.1007/978-3-642-15582-6_5

  14. Brunie N, Dinechin FD, Kupriianova O, Lauter C (2015) Code generators for mathematical functions. In: 2015 IEEE 22nd Symposium on Computer Arithmetic, pp 66–73. https://doi.org/10.1109/ARITH.2015.22

  15. Brisebarre N, Chevillard S (2007) Efficient polynomial L-approximations. In: 18th IEEE Symposium on Computer Arithmetic (ARITH ’07), pp 169–176. https://doi.org/10.1109/ARITH.2007.17

  16. Kupriianova O, Lauter C (2014) A domain splitting algorithm for the mathematical functions code generator. In: 48th Asilomar Conference on Signals, Systems and Computers, Pacific Grove, CA, 2014, pp 1271–1275. https://doi.org/10.1109/ACSSC.2014.7094664

  17. Hao JW, Xu JC, Guo SZ, Xia YY, Liu D (2019) Design and implementation of variable precision algorithm for transcendental functions. J Phys: Conf Ser 1325:012119. https://doi.org/10.1088/1742-6596/1325/1/012119

    Article  Google Scholar 

  18. Muller JM, Brunie N, Dinechin FD, Jeannerod CP et al (2018) Handbook of floating-point arithmetic, 2nd edn. Birkhäuser, Boston

    Book  Google Scholar 

  19. Brisebarre N, Muller JM, Tisserand A (2006) Computing machine-efficient polynomial approximations. ACM Trans Math Softw: TOMS 32(2):236–256. https://doi.org/10.1145/1141885.1141890

    Article  MathSciNet  MATH  Google Scholar 

  20. Tang Ping (1989) Table-driven implementation of the exponential function in IEEE floating-point arithmetic. ACM Trans Math Softw 15(2):144–157. https://doi.org/10.1145/63522.214389

    Article  MATH  Google Scholar 

  21. Tang Ping (1990) Table-driven implementation of the logarithm function in IEEE floating-point arithmetic. ACM Trans Math Softw 16(4):378–400. https://doi.org/10.1145/98267.98294

    Article  MATH  Google Scholar 

  22. Tang P (1991) Table lookup algorithms for elementary functions and their error analysis. In: Proceedings of the 10th IEEE Symposium on Computer Arithmetic. Argonne National Lab, pp 232–236. https://doi.org/10.1109/ARITH.1991.145565

  23. Ping Tang (1992) Table-driven implementation of the expm1 function in IEEE floating-point arithmetic. ACM Trans Math Softw 18(2):211–222. https://doi.org/10.1145/146847.146928

    Article  MathSciNet  MATH  Google Scholar 

  24. Bruce R, Devlin M, Marshall S (2008) An elementary transcendental function core library for reconfigurable computing. Reconfigurable Systems Summer Institute (RSSI 2007), pp 1–9. https://core.ac.uk/display/9022716

  25. Laurent F, Guillaume H, Vincent L, Patrick P, Paul Z (2007) MPFR: a multiple-precision binary floating-point library with correct rounding. ACM Trans Math Softw 33:13. https://doi.org/10.1145/1236463.1236468

    Article  MathSciNet  MATH  Google Scholar 

  26. Xu JC, Huang YZ, Guo SZ, Zhou B, Zhao J (2015) Testing platform for floating mathematical function libraries. J Softw 26(6):1306–1321. https://doi.org/10.13328/j.cnki.jos.004589

    Article  MathSciNet  Google Scholar 

  27. Xu JC, Guo SZ, Huang YZ, Wang L (2014) Access optimization technique for mathematical library of slave processors on heterogeneous many-core architectures. Comput Sci 41(06):12–17. https://doi.org/10.11896/j.issn.1002-137X.2014.06.003

    Article  Google Scholar 

  28. Dinechin FD, Lauter C, Melquiond G (2011) Certifying the floatingpoint implementation of an elementary function using Gappa. IEEE Trans Comput 60:242–253. https://doi.org/10.1109/TC.2010.128

    Article  MathSciNet  MATH  Google Scholar 

Download references

Acknowledgements

This work was supported by the National Natural Science Foundation of China—Precision analysis and optimization of basic mathematical functions on domestic processors (No. 61802434).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jinchen Xu.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Hao, J., Xu, J., Guo, S. et al. Design of variable precision transcendental function automatic generator. J Supercomput 78, 2196–2218 (2022). https://doi.org/10.1007/s11227-021-03937-8

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-021-03937-8

Keywords

Navigation