The MASS scalar library, libmass.a1, contains an accelerated set of frequently used math intrinsic functions in the Linux math library. When you compile programs with any of the following options:
If you are not using any of the optimization options listed above, and/or want to explicitly call the MASS scalar functions, you can do so by:
The MASS scalar functions accept double-precision parameters and return a double-precision result, and are summarized in Table 16.
Function | Description | Prototype |
---|---|---|
sqrt | Returns the square root of x | double sqrt (double x); |
rsqrt | Returns the reciprocal of the square root of x | double rsqrt (double x); |
exp | Returns the exponential function of x | double exp (double x); |
expm1 | Returns (the exponential function of x) - 1 | double expm1 (double x); |
log | Returns the natural logarithm of x | double log (double x); |
log1p | Returns the natural logarithm of (x + 1) | double log1p (double x); |
sin | Returns the sine of x | double sin (double x); |
cos | Returns the cosine of x | double cos (double x); |
tan | Returns the tangent of x | double tan (double x); |
atan | Returns the arctangent of x | double atan (double x); |
atan2 | Returns the arctangent of x/y | double atan2 (double x, double y); |
sinh | Returns the hyperbolic sine of x | double sinh (double x); |
cosh | Returns the hyperbolic cosine of x | double cosh (double x); |
tanh | Returns the hyperbolic tangent of x | double tanh (double x); |
dnint | Returns the nearest integer to x (as a double) | double dnint (double x); |
pow | Returns x raised to the power y | double pow (double x, double y); |
The trigonometric functions (sin, cos, tan) return NaN (Not-a-Number) for large arguments (abs(x)>2**50*pi).