Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

v?LinearFrac

Performs linear fraction transformation of vectors a and b with scalar parameters.

Syntax

call vslinearfrac( n, a, b, scalea, shifta, scaleb, shiftb, y )

call vslinearfraci(n, a, inca, b, incb, scalea, shifta, scaleb, shiftb, y, incy)

call vmslinearfrac( n, a, b, scalea, shifta, scaleb, shiftb, y, mode )

call vmslinearfraci(n, a, inca, b, incb, scalea, shifta, scaleb, shiftb, y, incy, mode)

call vdlinearfrac( n, a, b, scalea, shifta, scaleb, shiftb, y )

call vdlinearfraci(n, a, inca, b, incb, scalea, shifta, scaleb, shiftb, y, incy)

call vmdlinearfrac( n, a, b, scalea, shifta, scaleb, shiftb, y, mode )

call vmdlinearfraci(n, a, inca, b, incb, scalea, shifta, scaleb, shiftb, y, incy, mode)

Include Files

  • mkl_vml.f90

Input Parameters

Name

Type

Description

n

INTEGER, INTENT(IN)

Specifies the number of elements to be calculated.

a, b

DOUBLE PRECISION for vdlinearfrac, vmdlinearfrac

REAL, INTENT(IN) for vslinearfrac, vmslinearfrac

DOUBLE PRECISION, INTENT(IN) for vdlinearfrac, vmdlinearfrac

Arrays that specify the input vectors a and b.

inca, incb, incy

INTEGER, INTENT(IN)

Specifies increments for the elements of a, b, and y.

scalea, scaleb

DOUBLE PRECISION for vdlinearfrac, vmdlinearfrac

REAL, INTENT(IN) for vslinearfrac, vmslinearfrac

DOUBLE PRECISION, INTENT(IN) for vdlinearfrac, vmdlinearfrac

Constant values for scaling multipliers of vectors a and b.

shifta, shiftb

DOUBLE PRECISION for vdlinearfrac, vmdlinearfrac

REAL, INTENT(IN) for vslinearfrac, vmslinearfrac

DOUBLE PRECISION, INTENT(IN) for vdlinearfrac, vmdlinearfrac

Constant values for shifting addends of vectors a and b.

mode

INTEGER(KIND=8), INTENT(IN)

Overrides global VM mode setting for this function call. See vmlSetMode for possible values and their description.

Output Parameters

Name

Type

Description

y

DOUBLE PRECISION for vdlinearfrac, vmdlinearfrac

REAL, INTENT(OUT) for vslinearfrac, vmslinearfrac

DOUBLE PRECISION, INTENT(OUT) for vdlinearfrac, vmdlinearfrac

Array that specifies the output vector y.

Description

The v?LinearFrac function performs a linear fraction transformation of vector a by vector b with scalar parameters: scaling multipliers scalea, scaleb and shifting addends shifta, shiftb:

y[i]=(scalea·a[i]+shifta)/(scaleb·b[i]+shiftb), i=1,2 … n

The v?LinearFrac function is implemented in the EP accuracy mode only, therefore no special values are defined for this function. If used in HA or LA mode, v?LinearFrac sets the VM Error Status to VML_STATUS_ACCURACYWARNING (see the Values of the VM Status table). Correctness is guaranteed within the threshold limitations defined for each input parameter (see the table below); otherwise, the behavior is unspecified.

 

Threshold Limitations on Input Parameters
2EMIN/2 |scalea| 2(EMAX-2)/2
2EMIN/2 |scaleb| 2(EMAX-2)/2
|shifta| 2EMAX-2
|shiftb| 2EMAX-2
2EMIN/2a[i] 2(EMAX-2)/2
2EMIN/2b[i] 2(EMAX-2)/2
a[i] - (shifta/scalea)*(1-δ1), |δ1| 21-(p-1)/2
b[i] - (shiftb/scaleb)*(1-δ2), |δ2| 21-(p-1)/2

EMIN and EMAX are the minimum and maximum exponents and p is the number of significant bits (precision) for the corresponding data type according to the ANSI/IEEE Standard 754-2008 ([IEEE754]):

  • for single precision EMIN = -126, EMAX = 127, p = 24

  • for double precision EMIN = -1022, EMAX = 1023, p = 53

The thresholds become less strict for common cases with scalea=0 and/or scaleb=0:

  • if scalea=0, there are no limitations for the values of a[i] and shifta.

  • if scaleb=0, there are no limitations for the values of b[i] and shiftb.

To use the v?linearfrac to shift vector a by a scalar value, set scaleb to 0. Note that even if scaleb is 0, b must be declared.

To use the v?linearfrac to compute shifta/(scaleb·b[i]+shiftb), set scalea to 0. Note that even if scalea is 0, a must be declared.