IBM Support

MASS scalar library for Linux -- Overview

Product Documentation


Abstract

This document provides an overview of the MASS scalar library for Linux.

Content

The MASS scalar libraries, libmass.a (32-bit) and libmass_64.a (64-bit), contain an accelerated set of frequently-used mathematical functions.

The scalar libraries can be used with either Fortran or C/C++ applications and will run under SLES or RHEL Linux on IBM System p® and Power Architecture® processors. For 32-bit applications, use libmass.a. For 64-bit applications, use libmass_64.a.

C/C++ prototypes not already in math.h are available in mass.h. Fortran interfaces for functions that are not Fortran intrinsic functions are available in mass.include. A C/C++ calling program can obtain prototypes for all the scalar MASS functions by including both math.h and mass.h. A Fortran calling program should include mass.include.

Scalar library functions -- double precision
acos(x) returns the arc cosine of x
acosh(x) returns the arc hyperbolic cosine of x
asin(x) returns the arc sine of x
asinh(x) returns the arc hyperbolic sine of x
atan(x) returns the arc tangent of x
atan2(x,y) returns the arc tangent of x/y
atanh(x) returns the arc hyperbolic tangent of x
cbrt(x) returns the cube root of x
copysign(x,y) returns x with the sign of y
cos(x) returns the cosine of x
cosh(x) returns the hyperbolic cosine of x
cosisin(x) returns a complex number with real part cos(x) and imaginary part sin(x)
dnint(x) returns the nearest integer to x as a double
erf(x) returns the error function of x
erfc(x) returns the complimentary error function of x
exp(x) returns the exponential function of x
expm1(x) returns (the exponential function of x) - 1
hypot(x,y) returns the square root of x*x + y*y
lgamma(x) returns the natural logarithm of the absolute value of the gamma function of x
log(x) returns the natural logarithm of x
log10(x) returns the base-10 logarithm of x
log1p(x) returns the natural logarithm of (x+1)
pow(x,y) (C/C++) or x**y (Fortran) returns x raised to the power y
rint(x) returns the nearest integer to x as a double
rsqrt(x) returns the reciprocal of the square root of x
sincos(x, s, c) sets s to the sine of x and c to the cosine of x
sin(x) returns the sine of x
sinh(x) returns the hyperbolic sine of x
sqrt(x) returns the square root of x
tan(x) returns the tangent of x
tanh(x) returns the hyperbolic tangent of x

Scalar library functions -- single precision
(Unless otherwise noted, these compute the same operation as the corresponding double-precision versions above.)
acosf
acoshf
anint(x) returns the nearest integer to x as a float
asinf
asinhf
atan2f
atanf
atanhf
cbrtf
copysignf
cosf
coshf
erfcf
erff
expf
expm1f
hypotf
lgammaf
log10f
log1pf
logf
powf (C/C++) or ** (Fortran)
rintf(x) returns the nearest integer to x as a float
sinf
sinhf
tanf
tanhf

Example C/C++ prototypes and Fortran interfaces

When called from C, all the scalar MASS functions except dnint accept double arguments and return a double result. The dnint function takes a pointer to a double argument. When called from Fortran, all the scalar MASS functions accept real(8) arguments and return a real(8) result.

The C/C++ prototype or Fortran interface for the MASS scalar functions each has the form of the applicable one of the following examples:

Example C/C++ prototypes for the MASS scalar functions (double precision)
        double acos (double x);
    double atan2 (double x, double y);
    double _Complex cosisin (double x);
    void sincos (double x, double *s, double *c);
 
Example C/C++ prototypes for the MASS scalar functions (single precision)
        float acosf (float x);
        float atan2f (float x, float y);
        float _Complex cosisin (float);
        void sincos (float x, float *s, float *c);
 
Example Fortran interfaces for the MASS scalar functions (double precision)
        real*8 function acos (x)
          real*8, value :: x
        end function
        real*8 function atan2 (x, y)
          real*8, value ::  x, y
        end function
        complex*16 function cosisin (x)
          real*8, value ::  x
        end function
        subroutine sincos (x, s, c)
          real*8, value :: x
          real*8 s, c
        end function

Example Fortran interfaces for the MASS scalar functions (single precision)

        real*4 function acosf (x)


          real*4, value :: x
        end function
        real*4 function atan2f (x, y)
          real*4, value ::  x, y
        end function
        complex*8 function cosisinf (x)
          real*4, value ::  x
        end function
        subroutine sincosf (x, s, c)
          real*4, value :: x
          real*4 s, c
        end function

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.

[{"Product":{"code":"SSVKBV","label":"Mathematical Acceleration Subsystem"},"Business Unit":{"code":"BU050","label":"BU NOT IDENTIFIED"},"Component":"Libraries","Platform":[{"code":"PF016","label":"Linux"}],"Version":"5.0","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
17 June 2018

UID

swg27018494