24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Table 34. MASS Vector Library Functions (continued)<br />

vtanh vstanh (y,x,n) Sets y(i) to the hyperbolic<br />

tangent of x(i), <strong>for</strong> i=1,..,n<br />

The following example shows interface declarations <strong>for</strong> some of the MASS<br />

double-precision vector functions:<br />

interface<br />

subroutine vsqrt (y, x, n)<br />

real*8 y(*), x(*)<br />

integer n ! Sets y(i) to the square root of x(i), <strong>for</strong> i=1,..,n<br />

end subroutine vsqrt<br />

subroutine vrsqrt (y, x, n)<br />

real*8 y(*), x(*)<br />

integer n ! Sets y(i) to the reciprocal of the square root of x(i),<br />

! <strong>for</strong> i=1,..,n<br />

end subroutine vrsqrt<br />

end interface<br />

The following example shows interface declarations <strong>for</strong> some of the MASS<br />

single-precision vector functions:<br />

interface<br />

subroutine vssqrt (y, x, n)<br />

real*4 y(*), x(*)<br />

integer n ! Sets y(i) to the square root of x(i), <strong>for</strong> i=1,..,n<br />

end subroutine vssqrt<br />

subroutine vsrsqrt (y, x, n)<br />

real*4 y(*), x(*)<br />

integer n ! Sets y(i) to the reciprocal of the square root of x(i),<br />

! <strong>for</strong> i=1,..,n<br />

end subroutine vsrsqrt<br />

end interface<br />

The functions vatan2, vdiv, and vpow take four parameters and are of the <strong>for</strong>m<br />

function_name(z,x,y,n). The function vsincos takes four parameters of the <strong>for</strong>m<br />

function_name(y,z,x,n). The function vatan2 outputs a vector z whose elements are<br />

atan(x(i)/y(i)). The function vdiv outputs a vector z whose elements are x(i)/y(i),<br />

with i=1,..,n. The function vsincos outputs two vectors, y and z, whose elements<br />

are sin(x(i)) and cos(x(i)) respectively.<br />

In vcosisin(y,x,n), x is a vector of n real*8 elements and the function outputs a<br />

vector y of n complex*16 elements of the <strong>for</strong>m (cos(x(i)),sin(x(i))).<br />

Consistency of MASS Vector Functions<br />

In the interest of speed, the MASS libraries make certain trade-offs. One of these<br />

involves the consistency of certain MASS vector functions. For certain functions, it<br />

is possible that the result computed <strong>for</strong> a particular input value will vary slightly<br />

(usually only in the least significant bit) depending on its position in the vector, the<br />

vector length, and nearby elements of the input vector. Also, the results produced<br />

by the different MASS libraries are not necessarily bit-wise identical.<br />

422 <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> : User’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!