Mathematical Acceleration Subsystem (MASS) for AIX® consists of libraries of tuned mathematical intrinsic functions.
These libraries:
Include both scalar and vector functions.
Are thread-safe.
Support both 32-bit and 64-bit compilations.
Offer improved performance over their corresponding standard system library routines.
Are intended for use in C, C++, and Fortran applications where slight differences in accuracy or handling of exceptional values can be tolerated.
Mathematical Acceleration Subsystem for AIX includes the scalar and vector library groups described below:
Scalar library
The MASS scalar library, libmass.a, contains an accelerated set of frequently-used math intrinsic functions in the AIX math system system library, plus the added functions dnint for C/C++ and rsqrt for Fortran.
The libmass.a library can be used with either Fortran or C/C++ applications and will run under AIX on all of the IBM pSeries™ and RS/6000™ processors. The library contains the following scalar functions:
| Scalar Library Functions |
|
| sin | cos | tan | atan | sqrt |
| sinh | cosh | tanh | atan2 | rsqrt |
| exp | dnint | log | |
| pow (C/C++) | x**y (Fortran) |
When called from C, all the scalar MASS functions except dnint accept double-precision arguments and return a double-precision result. The dnint function takes a pointer to a double-precision argument.
When called from Fortran, all the scalar MASS functions accept double-precision arguments and return a double-precision result.
The trigonometric functions (sin, cos, tan) return NaN (Not-a-Number) for large arguments (abs(x)>2**50*pi). The pow (C/C++) and x**y (Fortran) functions accept negative x arguments with integer y arguments.
Back to top
Vector libraries
The general vector library, libmassv.a, contains vector functions that will run on all computers in the IBM pSeries and RS/6000 families. The library libmassvp3.a contains some functions that have been tuned for the POWER3 architecture, while the remaining functions are identical to those in libmassv.a.
Similarly, the library libmassvp4.a contains some functions that have been tuned for the POWER4 architecture, while the remaining functions are identical to those in libmassv.a.
The vector libraries libmassv.a, libmassvp3.a, and libmassvp4.a can be used with either Fortran or C/C++ applications. The accuracy of the vector functions is comparable to that of the corresponding scalar functions in libmass.a, though results may not be bitwise-identical.
| Vector Library Double-Precision Functions |
|
| vrec | vdiv | vsqrt | vrsqrt | vexp |
| vlog | vsin | vcos | vtan | vasin |
| vacos | vatan2 | vsincos | vcosisin | vdint |
| vdnint | vcosh | vexpm1 | vlog10 | vlog1p |
| vpow | vsinh | vtanh | |
| |
| Vector Library Single-Precision Functions |
|
| vsrec | vsdiv | vssqrt | vsrsqrt | vsexp |
| vslog | vssin | vscos | vstan | vsasin |
| vsacos | vsatan2 | vssincos | vscosisin | vscosh |
| vsexpm1 | vslog10 | vslog1p | vspow | vssinh |
| | | vstanh | | |
The MASS vector functions accept double-precision (or single-precision) vector input and output arguments, and an integer vector-length parameter.
Back to top
MASS vector functions source library
Successful use of the MASS vector libraries is contingent on the user vectorizing the application. To assist in that effort, the MASS vector Fortran and C/C++ source libraries are provided to enable application developers to write portable vector code that can run on non-IBM systems where the MASS libraries are not available.
The source library, libmassv.f, includes Fortran versions of all the vector functions in the MASS vector libraries.
The source library, libmassv.c, includes C/C++ versions of all the vector functions in the MASS vector libraries.
The syntax for the vector functions is visible in libmassv.f and libmassv.c, and the user can write code using these functions to obtain code that may port to systems other than the pSeries and RS/6000 systems. The user can then use the faster MASS vector libraries with that same code when running on a pSeries or RS/6000 system.
Back to top