Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference
Appendix A: Handling of Special Cases
Some mathematical functions implemented in Intel IPP are not defined for all possible argument values. This appendix describes how the corresponding Intel IPP functions used in signal processing domains handle situations when their input arguments fall outside the range of function definition or may lead to ambiguously determined output results.
The table “Special Cases for Intel IPP Signal Processing Functions” below summarizes these special cases for general vector functions described in Essential Functions and lists result values together with status codes returned by these functions. The status codes ending with Err (except for the ippStsNoErr status) indicate an error. When an error occurs, the function execution is interrupted. All other status codes indicate that the input argument is outside the range, but the function execution is continued with the corresponding result value.
Function Base Name |
Data Type |
Case Description |
Result Value |
Status Code |
16s |
Sqrt (x<0) |
0 |
ippStsSqrtNegArg |
|
8u |
Div (0/0) |
0 |
ippStsDivByZero |
|
all |
Div(x/0) |
- |
ippStsDivByZeroErr |
|
16s |
Ln (0) |
IPP_MIN_16S |
ippStsLnZeroArg |
|
16s |
overflow |
IPP_MAX_16S |
ippStsNoErr |
Here x denotes an input value. For the definition of the constants used, see Data Ranges in Intel® Integrated Performance Primitives Concepts.
Note that flavors of the same math function operating on different data types may produce different results for equal argument values. However, for a given function and a fixed data type, handling of special cases is the same for all function flavors that have different descriptors in their names. For example, the logarithm function ippiLn operating on 16s data treats zero argument values in the same way for all its flavors ippsLn_16s_Sfs and ippiLn_16s_ISfs.
The table below summarizes special cases for fixed-accuracy arithmetic functions.
Function Base Name |
Data Type |
Case Description |
Result Value |
Status Code |
32f |
Inv (x=+0) |
INF_32F |
ippStsSingularity |
|
32f |
Div (x>0, y=+0) |
INF_32F |
ippStsSingularity |
|
32f |
Sqrt(x<0) |
NAN_32F |
ippStsDomain |
|
32f |
InvSqrt (x<0) |
NAN_32F |
ippStsDomain |
|
32f |
InvCbrt (x=+0) |
INF_32F |
ippStsSingularity |
|
32f |
Pow3o2 (x<0) |
NAN_32F |
ippStsDomain |
|
32f |
Pow (x=+0, y=-ODD_INT) |
INF_32F |
ippStsSingularity |
|
32f |
Exp (x), x<underflow |
0 |
ippStsUnderflow |
|
32f |
Expm1(x), x>overflow |
INF_32F |
ippStsOverflow |
|
32f |
Ln(x<0) |
NAN_32F |
ippStsDomain |
|
32f |
Ln(x<-1) |
NAN_32F |
ippStsDomain |
|
32f |
Cos(INF) |
NAN_32F |
ippStsDomain |
|
32f |
Sin(INF) |
NAN_32F |
ippStsDomain |
|
32f |
SinCos(INF) |
NAN_32F, NAN_32F |
ippStsDomain |
|
32fc |
CIS(INF) |
NAN_32F, NAN_32F |
ippStsDomain |
|
32f |
Tan(INF) |
NAN_32F |
ippStsDomain |
|
32f |
Acos(x), |x|>1 |
NAN_32F |
ippStsDomain |
|
32f |
Asin(x), |x|>1 |
NAN_32F |
ippStsDomain |
|
32f |
Cosh(x), |x|>overflow |
INF_32F |
ippStsOverflow |
|
32f |
Sinh(x), |x|>overflow |
INF_32F |
ippStsOverflow |
|
32f |
Acosh(x<1) |
NAN_32F |
ippStsDomain |
|
32f |
Atanh(x=1) |
INF_32F |
ippStsSingularity |
|
32f |
Erfc(x), |x|>underflow |
0 |
ippStsUnderflow |
|
32f |
ErfInv(x=1) |
INF_32F |
ippStsSingularity |
|
32f |
ErfcInv(x=2) |
-INF_32F |
ippStsSingularity |
|
32f |
CdfNorm(x), |x|<underflow |
0 |
ippStsUnderflow |
|
32f |
CdfNormInv(x=1) |
INF_32F |
ippStsSingularity |