Exp

Computes e to the power of each element of a vector.

Syntax

IppStatus ippsExp_32f(const Ipp32f* pSrc, Ipp32f* pDst, int len);

IppStatus ippsExp_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len);

IppStatus ippsExp_32f64f(const Ipp32f* pSrc, Ipp64f* pDst, int len);

IppStatus ippsExp_32f_I(Ipp32f* pSrcDst, int len);

IppStatus ippsExp_64f_I(Ipp64f* pSrcDst, int len);

IppStatus ippsExp_16s_Sfs(const Ipp16s* pSrc, Ipp16s* pDst, int len, int scaleFactor);

IppStatus ippsExp_32s_Sfs(const Ipp32s* pSrc, Ipp32s* pDst, int len, int scaleFactor);

IppStatus ippsExp_64s_Sfs(const Ipp64s* pSrc, Ipp64s* pDst, int len, int scaleFactor);

IppStatus ippsExp_16s_ISfs(Ipp16s* pSrcDst, int len, int scaleFactor);

IppStatus ippsExp_32s_ISfs(Ipp32s* pSrcDst, int len, int scaleFactor);

IppStatus ippsExp_64s_ISfs(Ipp64s* pSrcDst, int len, int scaleFactor);

Parameters

pSrc

Pointer to the source vector.

pDst

Pointer to the destination vector.

pSrcDst

Pointer to the source and destination vector pSrcDst for the in-place operation.

len

Number of elements in the vector

scaleFactor

Scale factor, refer to Integer Scaling.

Description

The function ippsExp is declared in the ipps.h file. This function computes the exponential function of each element of the vector pSrc, and stores the result in pDst.

The computation is performed as follows:

pDst[n] = epSrc[n]

The in-place flavors of ippsExp compute the exponential function of each element of the vector pSrcDst and store the result in pSrcDst.

The computation is performed as follows:

pSrcDst[n] = epSrcDst[n]

When an overflow occurs, the function continues operation with the corresponding result value (see appendix A "Handling of Special Cases" for more information).

When computing the exponent of an integer number, the output result can exceed the data range and become saturated. The scaling retains the output data range but results in precision loss in low-order bits. The function ippsExp_32f64f computes the output result in a higher precision data range.

The examples below show how to call the functions ippsExp_16s_ISfs and ippsExp_64f_I respectively.

Application Notes

For the functions ippsExp and ippsLn the result is rounded to the nearest integer after scaling.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pSrc, pDst, or pSrcDst pointer is NULL.

ippStsSizeErr

Indicates an error when len is less than or equal to 0.

Using the ippsExp_16s_ISfs Function

IppStatus exp16s(void) {
      Ipp16s x[4] = {-1, 2, 30, 0};
      IppStatus st = ippsExp_16s_ISfs(x, 4, -1);
      printf_16s(“exp16s =”, x, 4, st);
      return st;
}
Output: 
    exp16s =  1 15 32767 2

Using the ippsExp_64f_I Function

IppStatus exp64f(void) {
      Ipp64f x[4] = {-1, 2, 1, log(1.234567)};
      IppStatus st = ippsExp_64f_I(x, 4);
      printf_64f(“exp64f =”, x, 4, st);
      return st;
}
Output: 
    exp64f =  0.367879 7.389056 2.718282 1.234567

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.