# MASS Fortran interface blocks for AIX

## Abstract

This document provides Fortran interface blocks for MASS scalar and vector functions.

## Content

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

c     Fortran interface blocks for the MASS scalar functions.
c     Interface declarations for MASS scalar functions that are
c     not Fortran intrinsic functions are also available in
c     mass.include.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c     Fortran interface block for the single-precision MASS
c     scalar functions.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

interface

real*4 function acosf (%val(x))
real*4 x
c       Returns the arccosine of x.
end function acosf

real*4 function acoshf (%val(x))
real*4 x
c       Returns the arc hyperbolic cosine of x.
end function acoshf

real*4 function asinf (%val(x))
real*4 x
c       Returns the arcsine of x.
end function asinf

real*4 function asinhf (%val(x))
real*4 x
c       Returns the arc hyperbolic sine of x.
end function asinhf

real*4 function atan2f (%val(x), %val(y))
real*4 x, y
c       Returns the arctangent of x/y.
end function atan2f

real*4 function atanf (%val(x))
real*4 x
c       Returns the arctangent of x.
end function atanf

real*4 function atanhf (%val(x))
real*4 x
c       Returns the arc hyperbolic tangent of x.
end function atanhf

real*4 function cbrtf  (%val(x))
real*4 x
c       Returns the cube root of x.
end function cbrtf

real*4 function copysignf (%val(x), %val(y))
real*4 x, y
c       Returns a value with the magnitude of x and the sign of y.
end function copysignf

real*4 function cosf (%val(x))
real*4 x
c       Returns the cosine of x.
end function cosf

real*4 function coshf (%val(x))
real*4 x
c       Returns the hyperbolic cosine of x.
end function coshf

real*4 function erff (%val(x))
real*4 x
c       Returns the error function of x.
end function erff

real*4 function erfcf (%val(x))
real*4 x
c       Returns 1.0 - the error function of x.
end function erfcf

real*4 function expf (%val(x))
real*4 x
c       Returns the exponential function of x.
end function expf

real*4 function expm1f (%val(x))
real*4 x
c       Returns (the exponential function of x)-1.
end function expm1f

real*4 function hypotf (%val(x), %val(y))
real*4 x, y
c       Returns the square root of x2+ y2   .
end function hypotf

real*4 function lgammaf (%val(x))
real*4 x
c       Returns the natural logarithm of the absolute value of the
c       gamma function of x.
end function lgammaf

real*4 function logf (%val(x))
real*4 x
c       Returns the natural logarithm of x.
end function logf

real*4 function log10f (%val(x))
real*4 x
c       Returns the base-10 logarithm of x.
end function log10f

real*4 function log1pf (%val(x))
real*4 x
c       Returns the natural logarithm of (x-1).
end function log1pf

real*4 function powf (%val(x), %val(y))
real*4 x, y
c       Returns the value of x raised to the power y.
end function powf

real*4 function rintf (%val(x))
real*4 x
c       Rounds x to an integer value according to the current
c       rounding mode.  The default rounding mode is to round
c       to the nearest integer.
end function rintf

real*4 function sinf (%val(x))
real*4 x
c       Returns the sine of x.
end function sinf

real*4 function sinhf (%val(x))
real*4 x
c       Returns the hyperbolic sine of x.
end function sinhf

real*4 function tanf  (%val(x))
real*4 x
c       Returns the tangent of x.
end function tanf

real*4 function tanhf (%val(x))
real*4 x
c       Returns the hyperbolic tangent of x.
end function tanhf

end interface

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c     Fortran interface block for the double-precision MASS
c     scalar functions.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

interface

real*8 function acos (%val(x))
real*8 x
c       Returns the arccosine of x.
end function acos

real*8 function acosh (%val(x))
real*8 x
c       Returns the arc hyperbolic cosine of x.
end function acosh

real*8 function asin (%val(x))
real*8 x
c       Returns the arcsine of x.
end function asin

real*8 function asinh (%val(x))
real*8 x
c       Returns the arc hyperbolic sine of x.
end function asinh

real*8 function atan (%val(x))
real*8 x
c       Returns the arctangent of x.
end function atan

real*8 function atan2 (%val(x), %val(y))
real*8 x, y
c       Returns the arctangent of x/y.
end function atan2

real*8 function atanh (%val(x))
real*8 x
c       Returns the arc hyperbolic tangent of x.
end function atanh

real*8 function cbrt (%val(x))
real*8 x
c       Returns the cube root of x.
end function cbrt

real*8 function copysign (%val(x), %val(y))
real*8 x, y
c       Returns a value with the magnitude of x and the sign of y.
end function copysign

real*8 function cos (%val(x))
real*8 x
c       Returns the cosine of x.
end function cos

real*8 function cosh (%val(x))
real*8 x
c       Returns the hyperbolic cosine of x.
end function cosh

complex*16 function cosisin (%val(x))
real*8 x
c       Returns a complex number with real part the sine of x and
c       imaginary part the cosine of x.
end function cosisin

real*8 function dnint (%val(x))
real*8 x
c       Returns the nearest integer to x (as a real*8 value).
end function dnint

real*8 function erf (%val(x))
real*8 x
c       Returns the error function of x.
end function erf

real*8 function erfc (%val(x))
real*8 x
c       Returns 1.0 - the error function of x.
end function erfc

real*8 function exp (%val(x))
real*8 x
c       Returns the exponential function of x.
end function exp

real*8 function expm1 (%val(x))
real*8 x
c       Returns (the exponential function of x)-1
end function expm1

real*8 function hypot (%val(x), %val(y))
real*8 x, y
c       Returns the square root of x*x + y*y.
end function hypot

real*8 function lgamma (%val(x))
real*8 x
c       Returns the natural logarithm of the absolute value of the
c       gamma function of x.
end function lgamma

real*8 function log (%val(x))
real*8 x
c       Returns the natural logarithm of x.
end function log

real*8 function log10 (%val(x))
real*8 x
c       Returns the base-10 logarithm of x.
end function log10

real*8 function log1p (%val(x))
real*8 x
c       Returns the natural logarithm of (x+1)
end function log1p

c     ** operator
c     real*8 x, y
c     x**y returns x raised to the power y.

real*8 function rsqrt (%val(x))
real*8 x
c       Returns the reciprocal of the square root of x.
end function rsqrt

real*8 function sin (%val(x))
real*8 x
c       Returns the sine of x.
end function sin

subroutine sincos (%val(x), s, c)
real*8 x, s, c
c       Sets s to the sine of x and c to the cosine of x.
end subroutine sincos

real*8 function sinh (%val(x))
real*8 x
c       Returns the hyperbolic sine of x.
end function sinh

real*8 function sqrt (%val(x))
real*8 x
c       Returns the square root of x.
end function sqrt

real*8 function tan (%val(x))
real*8 x
c       Returns the tangent of x.
end function tan

real*8 function tanh (%val(x))
real*8 x
c       Returns the hyperbolic tangent of x.
end function tanh

end interface

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c     Fortran interface blocks for MASS vector functions.
c     These interface blocks are also in massv.include.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c     Fortran interface block for MASS double-precision vector
c     functions.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

interface

subroutine vacos (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the arccosine of x(i), for i=1,..,n
end subroutine vacos

subroutine vacosh (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the arc hyperbolic cosine of x(i),
c       for i=1,..,n
end subroutine vacosh

subroutine vasin(y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the arcsine of x(i), for i=1,..,n
end subroutine vasin

subroutine vasinh (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the arc hyperbolic sine of x(i), for i=1,..,n
end subroutine vasinh

subroutine vatan (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the arc tangent of x(i), for i=1,..,n.
c       (libmassvp7.a only)
end subroutine vatan

subroutine vatan2 (z, x, y, n)
real*8 z(*), x(*), y(*)
integer n
c       Sets z(i) to the arctangent of x(i)/y(i), for i=1,..,n
end subroutine vatan2

subroutine vatanh (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the arc hyperbolic tangent of x(i),
c       for i=1,..,n
end subroutine vatanh

subroutine vcbrt (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the cube root of x(i), for i=1,..,n
end subroutine vcbrt

subroutine vcos (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the cosine of x(i), for i=1,..,n
end subroutine vcos

subroutine vcosh (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the hyperbolic cosine of x(i), for i=1,..,n
end subroutine vcosh

subroutine vcosisin (y, x, n)
complex*16 y(*)
real*8 x(*)
integer n
c       Sets the real part of y(i) to the cosine of x(i) and the
c       imaginary part c of y(i) to the sine of x(i), for i=1,..,n
end subroutine vcosisin

subroutine vdint (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the integer truncation of x(i), for i=1,..,n
end subroutine vdint

subroutine vdiv (z, x, y, n)
real*8 z(*), x(*), y(*)
integer n
c       Sets z(i) to x(i)/y(i), for i=1,..,n
end subroutine vdiv

subroutine vdnint (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the nearest integer to x(i), for i=1,..,n
end subroutine vdnint

subroutine verf (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the error function of x(i),
c       for i=1,..,n.  (libmassvp7.a only)
end subroutine verf

subroutine verfc (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the complimentary error function of x(i),
c       for i=1,..,n.  (libmassvp7.a only)
end subroutine verfc

subroutine vexp (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the exponential function of x(i),
c       for i=1,..,n
end subroutine vexp

subroutine vexpm1 (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to (the exponential function of x(i))-1,
c       for i=1,..,n
end subroutine vexpm1

subroutine vexp2 (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to 2 raised to the power of x(i),
c       for i=1,..,n.  (libmassvp7.a only)
end subroutine vexp2

subroutine vexp2m1 (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to (2 raised to the power of x(i))-1,
c       for i=1,..,n.  (libmassvp7.a only)
end subroutine vexp2m1

subroutine vhypot (z, x, y, n)
real*8 z(*), x(*), y(*)
integer n
c       Sets z(i) to the square root of the sum of the squares of
c       x(i) and y(i), for i=1,..,n.  (libmassvp7.a only)
end subroutine vhypot

subroutine vlgamma (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the natural logarithm of the absolute value
c       of the gamma function of x(i), for i=1,..,n.
c       (libmassvp7.a only)
end subroutine vlgamma

subroutine vlog (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the natural logarithm of x(i), for i=1,..,n
end subroutine vlog

subroutine vlog10 (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the base-10 logarithm of x(i), for i=1,..,n
end subroutine vlog10

subroutine vlog1p (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the natural logarithm of (x(i)+1),
c       for i=1,..,n
end subroutine vlog1p

subroutine vlog2 (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the base-2 logarithm of x(i), for i=1,..,n.
c       (libmassvp7.a only)
end subroutine vlog2

subroutine vlog21p (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the base-2 logarithm of (x(i)+1),
c       for i=1,..,n.  (libmassvp7.a only)
end subroutine vlog21p

subroutine vpow (z, x, y, n)
real*8 z(*), x(*), y(*)
integer n
c       Sets z(i) to x(i) raised to the power y(i), for i=1,..,n
end subroutine vpow

subroutine vqdrt (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the 4th root of x(i), for i=1,..,n
end subroutine vqdrt

subroutine vrcbrt (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the reciprocal of the cube root of x(i),
c       for i=1,..,n
end subroutine vrcbrt

subroutine vrec (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the reciprocal of x(i), for i=1,..,n
end subroutine vrec

subroutine vrqdrt (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the reciprocal of the 4th root of x(i),
c       for i=1,..,n
end subroutine vrqdrt

subroutine vrsqrt (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the reciprocal of the square root of x(i),
c       for i=1,..,n
end subroutine vrsqrt

subroutine vsin (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the sine of x(i), for i=1,..,n
end subroutine vsin

subroutine vsincos (y, z, x, n)
real*8 y(*), z(*), x(*)
integer n
c       Sets y(i) to the sine of x(i)
c       and z(i) to the cosine of x(i), i=1,..,n
end subroutine vsincos

subroutine vsinh (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the hyperbolic sine of x(i), for i=1,..,n
end subroutine vsinh

subroutine vsqrt (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the square root of x(i), for i=1,..,n
end subroutine vsqrt

subroutine vtan (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the tangent of x(i), for i=1,..,n
end subroutine vtan

subroutine vtanh (y, x, n)
real*8 y(*), x(*)
integer n
c       Sets y(i) to the hyperbolic tangent of x(i), for i=1,..,n
end subroutine vtanh

end interface

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c     Fortran interface block for MASS single-precision vector
c     functions.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

interface

subroutine vsacos (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the arccosine of x(i), for i=1,..,n
end subroutine vsacos

subroutine vsacosh (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the arc hyperbolic cosine of x(i),
c       for i=1,..,n
end subroutine vsacosh

subroutine vsasin(y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the arcsine of x(i), for i=1,..,n
end subroutine vsasin

subroutine vsasinh (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the arc hyperbolic sine of x(i), for i=1,..,n
end subroutine vsasinh

subroutine vsatan (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the arc tangent of x(i), for i=1,..,n.
c       (libmassvp7.a only)
end subroutine vsatan

subroutine vsatan2 (z, x, y, n)
real*4 z(*), x(*), y(*)
integer n
c       Sets z(i) to the arctangent of x(i)/y(i), for i=1,..,n
end subroutine vsatan2

subroutine vsatanh (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the arc hyperbolic tangent of x(i),
c       for i=1,..,n
end subroutine vsatanh

subroutine vscbrt (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the cube root of x(i), for i=1,..,n
end subroutine vscbrt

subroutine vscos (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the cosine of x(i), for i=1,..,n
end subroutine vscos

subroutine vscosh (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the hyperbolic cosine of x(i), for i=1,..,n
end subroutine vscosh

subroutine vscosisin (y, x, n)
complex*16 y(*)
real*4 x(*)
integer n
c       Sets the real part of y(i) to the cosine of x(i) and the
c       imaginary part c of y(i) to the sine of x(i), for i=1,..,n
end subroutine vscosisin

subroutine vsdiv (z, x, y, n)
real*4 z(*), x(*), y(*)
integer n
c       Sets z(i) to x(i)/y(i), for i=1,..,n
end subroutine vsdiv

subroutine vserf (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the error function of x(i),
c       for i=1,..,n.  (libmassvp7.a only)
end subroutine vserf

subroutine vserfc (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the complimentary error function of x(i),
c       for i=1,..,n.  (libmassvp7.a only)
end subroutine vserfc

subroutine vsexp (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the exponential function of x(i),
c       for i=1,..,n
end subroutine vsexp

subroutine vsexpm1 (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to (the exponential function of x(i))-1,
c       for i=1,..,n
end subroutine vsexpm1

subroutine vsexp2 (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to 2 raised to the power of x(i),
c       for i=1,..,n.  (libmassvp7.a only)
end subroutine vsexp2

subroutine vsexp2m1 (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to (2 raised to the power of x(i))-1,
c       for i=1,..,n.  (libmassvp7.a only)
end subroutine vsexp2m1

subroutine vshypot (z, x, y, n)
real*4 z(*), x(*), y(*)
integer n
c       Sets z(i) to the square root of the sum of the squares of
c       x(i) and y(i), for i=1,..,n.  (libmassvp7.a only)
end subroutine vshypot

subroutine vslog (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the natural logarithm of x(i), for i=1,..,n
end subroutine vslog

subroutine vslog10 (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the base-10 logarithm of x(i), for i=1,..,n
end subroutine vslog10

subroutine vslog1p (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the natural logarithm of (x(i)+1),
c       for i=1,..,n
end subroutine vslog1p

subroutine vslog2 (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the base-2 logarithm of x(i), for i=1,..,n.
c       (libmassvp7.a only)
end subroutine vslog2

subroutine vslog21p (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the base-2 logarithm of (x(i)+1),
c       for i=1,..,n.  (libmassvp7.a only)
end subroutine vslog21p

subroutine vspow (z, x, y, n)
real*4 z(*), x(*), y(*)
integer n
c       Sets z(i) to x(i) raised to the power y(i), for i=1,..,n
end subroutine vspow

subroutine vsqdrt (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the 4th root of x(i), for i=1,..,n
end subroutine vsqdrt

subroutine vsrcbrt (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the reciprocal of the cube root of x(i),
c       for i=1,..,n
end subroutine vsrcbrt

subroutine vsrec (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the reciprocal of x(i), for i=1,..,n
end subroutine vsrec

subroutine vsrqdrt (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the reciprocal of the 4th root of x(i),
c       for i=1,..,n
end subroutine vsrqdrt

subroutine vsrsqrt (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the reciprocal of the square root of x(i),
c       for i=1,..,n
end subroutine vsrsqrt

subroutine vssin (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the sine of x(i), for i=1,..,n
end subroutine vssin

subroutine vssincos (y, z, x, n)
real*4 y(*), z(*), x(*)
integer n
c       Sets y(i) to the sine of x(i) and z(i) to the cosine
c       of x(i), i=1,..,n
end subroutine vssincos

subroutine vssinh (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the hyperbolic sine of x(i), for i=1,..,n
end subroutine vssinh

subroutine vssqrt (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the square root of x(i), for i=1,..,n
end subroutine vssqrt

subroutine vstan (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the tangent of x(i), for i=1,..,n
end subroutine vstan

subroutine vstanh (y, x, n)
real*4 y(*), x(*)
integer n
c       Sets y(i) to the hyperbolic tangent of x(i), for i=1,..,n
end subroutine vstanh

end interface

cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c     Fortran interface block for MASS integer vector functions.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

interface

integer*4 function vpopcnt4 (x, n)
integer*4 x(*), n
c       Returns the total number of 1 bits in the concatenation
c       of the binary representation of x(i), for i=1,...,n.
end function vpopcnt4

integer*4 function vpopcnt8 (x, n)
integer*8 x(*), n
c       Returns the total number of 1 bits in the concatenation
c       of the binary representation of x(i), for i=1,...,n.
end function vpopcnt8

end interface

Cross reference information
Segment Product Component Platform Version Edition
Operating System AIX family
pSeries Unix Servers (incl pSeries Intellistation) pSeries - Enterprise Servers
RS/6000 (Servers and Workstations) RS/6000 Enterprise Servers
Software Development XL C Enterprise Edition for AIX Not Applicable AIX All Versions
Software Development VisualAge C++ AIX All versions
Software Development XL Fortran AIX, AIXL All versions
Software Development XL C/C++ AIX, AIX5L, AIXL All Versions

### Document information

More support for: Mathematical Acceleration Subsystem
Libraries

Software version: 6.0

Operating system(s): AIX

Reference #: 7005377

Modified date: 13 April 2010