Using the MASS scalar library

The MASS scalar library contains an accelerated set of frequently used math intrinsic functions. They are compatible with 31-bit C linkage, 31-bit XPLINK, and 64-bit. If you want to explicitly call the MASS scalar functions, you can take the following steps:
  1. Provide the prototypes for the functions by including math.h and mass.h in your source files. See the table below for the location of header files.
  2. Link the appropriate scalar library with your application. Names of libraries are described in the following table.
Table 1. Header files and library names for the MASS scalar library
System Environment Header file location Library name for zEC12/zBC12 Library name for z13
USS
  • /usr/include/math.h
  • /usr/include/mass.h
/usr/lpp/cbclib/lib/libmass.arch10.a /usr/lpp/cbclib/lib/libmass.arch11.a
MVS™ CEE.SCEEH.H
  • CBC.SCCNM10 (for functions that overlap with <math.h>)
  • CBC.SCCNN10 (for functions which are only introduced in <mass.h>)
  • CBC.SCCNM11 (for functions that overlap with <math.h>)
  • CBC.SCCNN11 (for functions which are only introduced in <mass.h>)
Note: MASS scalar functions can only run on IBM® zEC12/zBC12/z13 and newer machine models. A set of libraries tuned for each machine model group are provided.
The MASS scalar functions accept double-precision parameters and return a double-precision result, or accept single-precision parameters and return a single-precision result, except sincos which gives 2 double-precision results. They are summarized in Table 2
Table 2. MASS scalar functions
Double-precision function Single-precision function Description Double-precision function prototype Single-precision function prototype
acos acosf Returns the arc cosine of x double acos (double x); float acosf (float x);
acosh acoshf Returns the arc hyperbolic cosine of x double acosh (double x); float acoshf (float x);
  anintt Returns the nearest integer to x (as a float) float anint (float x);
asin asinf Returns the arc sine of x double asin (double x); float asinf (float x);
asinh asinhf Returns the arc hyperbolic sine of x double asinh (double x); float asinhf (float x);
atan2 atan2f Returns the arc tangent of x/y double atan2 (double x, double y); float atan2f (float x, float y);
atan atanf Returns the arc tangent of x double atan (double x); float atanf (float x);
atanh atanhf Returns the arc hyperbolic tangent of x double atanh (double x); float atanhf (float x);
cbrt cbrtf Returns the cube root of x double cbrt (double x); float cbrtf (float x);
copysign copysignf Returns x with the sign of y double copysign (double x,double y); float copysignf (float x);
cos cosf Returns the cosine of x double cos (double x); float cosf (float x);
cosh coshf Returns the hyperbolic cosine of x double cosh (double x); float coshf (float x);
cosisin   Returns a complex number with the real part cosine of x and the imaginary part sine of x. double_Complex cosisin (double);  
dnintt   Returns the nearest integer to x (as a double) double dnint (double x);  
erf erff Returns the error function of x double erf (double x); float erff (float x);
erfc erfcf Returns the complementary error function of x double erfc (double x); float erfcf (float x);
exp expf Returns the exponential function of x double exp (double x); float expf (float x);
expm1 expm1f Returns (the exponential function of x) - 1 double expm1 (double x); float expm1f (float x);
hypot hypotf Returns the square root of x2 + y2 double hypot (double x, double y); float hypotf (float x, float y);
lgamma lgammaf Returns the natural logarithm of the absolute value of the Gamma function of x double lgamma (double x); float lgammaf (float x);
log logf Returns the natural logarithm of x double log (double x); float logf (float x);
log10 log10f Returns the base 10 logarithm of x double log10 (double x); float log10f (float x);
log1p log1pf Returns the natural logarithm of (x + 1) double log1p (double x); float log1pf (float x);
pow powf Returns x raised to the power y double pow (double x, double y); float powf (float x, float y);
rint rintf Returns the nearest integer to x (as a double) double rint (double x); float rintf (float x);
rsqrtt   Returns the reciprocal of the square root of x double rsqrt (double x);  
sin sinf Returns the sine of x double sin (double x); float sinf (float x);
sincost   Sets *s to the sine of x and *c to the cosine of x void sincos (double x, double* s, double* c);  
sinh sinhf Returns the hyperbolic sine of x double sinh (double x); float sinhf (float x);
sqrt   Returns the square root of x double sqrt (double x);  
tan tanf Returns the tangent of x double tan (double x); float tanf (float x);
tanh tanhf Returns the hyperbolic tangent of x double tanh (double x); float tanhf (float x);
Notes:
  • Functions denoted as function-namet are declared in <mass.h>, and all other functions are declared in <math.h>.
  • The trigonometric functions (sin, cos, tan) return NaN (Not-a-Number) for large arguments (where the absolute value is greater than 250pi).
  • The pow function accepts negative x arguments with integer y arguments according to the C standard.
  • In some cases, the MASS functions are not as precise as the system library, and they might handle edge cases differently (sqrt(Inf), for example).