Optimized math routines - libamath

libamath (in the /opt/arm/<armpl_dir>/lib directory) contains AArch64-optimized versions of the following scalar functions, in both single and double precision: exponential (expexp2), logarithm (loglog2log10), and error functions (erferfc). In addition, optimized single precision sine and cosine functions are included (sinfcosfsincosf). Linking to libamath ahead of libm will ensure use of these optimized functions.

libamath also contains vectorized versions (Neon and SVE) of all of the common math.h functions in libm. To provide an enhanced performance using optimized functions, these functions are used by Arm C/C++ Compiler whenever possible.The compiler automatically links to the libamath library. You do not have to supply any specific compiler options to initiate this behavior.

When using libamath with the GCC compiler, you must explicitly link to the libamath library before linking to libm. For example:

gcc code_with_math_routines.c -lamath -lm
gfortran code_with_math_routines.f -lamath -lm

Previous Next