Contents

# Special Functions

Many routines in the
Intel® oneAPI
DPC++/C++
Compiler
Math Library are more optimized for Intel® microprocessors than for non-Intel microprocessors.
The
mathimf.h
Intel® oneAPI
DPC++/C++
Compiler
Math Library functions.
The math library supports the following special functions:
FP16 Math Functions have the following requirements:
• Version 2021.4 or higher of the Intel® oneAPI DPC++/C++ Compiler.
• A next-generation Intel® Xeon® Scalable processor, code name Sapphire Rapids.

## annuity

Description:
The
annuity
function computes the present value factor for an annuity,
(1 - (1+x)
(-y)
) / x
, where
x
is a rate and
y
is a period.
errno
: ERANGE, for underflow and overflow conditions
Calling interface:
double annuity(double x, double y);
long double annuityl(long double x, long double y);
float annuityf(float x, float y);
_Float16 annuityf16(_Float16 x, _Float16 y);

## cdfnorm

Description:
The
cdfnorm
function returns the cumulative normal distribution function value.
Calling interface:
double cdfnorm(double x);
float cdfnormf(float x);
_Float16 cdfnormf16 (_Float16 x);

## cdfnorminv

Description:
The
cdfnorminv
function returns the inverse cumulative normal distribution function value.
errno
:
EDOM, for finite or infinite
(x > 1) || (x < 0)
ERANGE, for
x = 0 or x = 1
Calling interface:
double cdfnorminv(double x);
float cdfnorminvf (float x);
_Float16 cdfnorminvf16 (_Float16 x);

## compound

Description:
The
compound
function computes the compound interest factor,
(1+x)
y
, where
x
is a rate and
y
is a period.
errno
: ERANGE, for underflow and overflow conditions
Calling interface:
double compound(double x, double y);
long double compoundl(long double x, long double y);
float compoundf(float x, float y);
_Float16 compoundf16(_Float16 x, _Float16 y);

## erf

Description:
The
erf
function returns the error function value.
Calling interface:
double erf(double x);
long double erfl(long double x);
float erff(float x);
_Float16 erff16(_Float16 x);

## erfc

Description:
The
erfc
function returns the complementary error function value.
errno
: ERANGE, for underflow conditions
Calling interface:
double erfc(double x);
long double erfcl(long double x);
float erfcf(float x);
_Float16 erfcf16(_Float16 x);

## erfcx

Description:
The
erfcx
function returns the scaled complementary error function value.
errno
: ERANGE, for overflow conditions
Calling interface:
double erfcx(double x);
float erfcxf(float x);

## erfcinv

Description:
The
erfcinv
function returns the value of the inverse complementary error function of
x
.
errno
: EDOM, for finite or infinite (x > 2) || (x < 0)
Calling interface:
double erfcinv(double x);
float erfcinvf(float x);
_Float16 erfcinvf16(_Float16 x);

## erfinv

Description:
The
erfinv
function returns the value of the inverse error function of
x
.
errno
: EDOM, for finite or infinite |x| > 1
Calling interface:
double erfinv(double x);
long double erfinvl(long double x);
float erfinvf(float x);
_Float16 erfinvf16(_Float16 x);

## gamma

Description:
The
gamma
function returns the value of the logarithm of the absolute value of gamma.
errno:
ERANGE, for overflow conditions when x is a negative integer.
Calling interface:
double gamma(double x);
long double gammal(long double x);
float gammaf(float x);
_Float16 gammaf16(_Float16 x);

## gamma_r

Description:
The
gamma_r
function returns the value of the logarithm of the absolute value of gamma. The sign of the gamma function is returned in the integer
signgam
.
Calling interface:
double gamma_r(double x, int *signgam);
long double gammal_r(long double x, int *signgam);
float gammaf_r(float x, int *signgam);
_Float16 gammaf16_r(_Float16 x, int *signgam);

## j0

Description:
Computes the Bessel function (of the first kind) of
x
with order 0.
Calling interface:
double j0(double x);
long double j0l(long double x);
float j0f(float x);
_Float16 j0f16(_Float16 x);

## j1

Description:
Computes the Bessel function (of the first kind) of
x
with order 1.
Calling interface:
double j1(double x);
long double j1l(long double x);
float j1f(float x);
_Float16 j1f16(_Float16 x);

## jn

Description:
Computes the Bessel function (of the first kind) of
x
with order
n
.
Calling interface:
double jn(int n, double x);
long double jnl(int n, long double x);
float jnf(int n, float x);
_Float16 jnf16(int n, _Float16 x);

## lgamma

Description:
The
lgamma
function returns the value of the logarithm of the absolute value of gamma.
errno
: ERANGE, for overflow conditions, x=0 or negative integers.
Calling interface:
double lgamma(double x);
long double lgammal(long double x);
float lgammaf(float x);
_Float16 lgammaf16(_Float16 x);

## lgamma_r

Description:
The
lgamma_r
function returns the value of the logarithm of the absolute value of gamma. The sign of the gamma function is returned in the integer
signgam
.
errno
: ERANGE, for overflow conditions, x=0 or negative integers.
Calling interface:
double lgamma_r(double x, int *signgam);
long double lgammal_r(long double x, int *signgam);
float lgammaf_r(float x, int *signgam);
_Float16 lgammaf16_r(_Float16 x, int *signgam);

## tgamma

Description:
The
tgamma
function computes the gamma function of
x
.
errno
:
EDOM, for x=0 or negative integers.
ERANGE, for overflow conditions.
Calling interface:
double tgamma(double x);
long double tgammal(long double x);
float tgammaf(float x);
_Float16 tgammaf16(_Float16 x);

## y0

Description:
Computes the Bessel function (of the second kind) of
x
with order 0.
errno
: EDOM, for x <= 0
Calling interface:
double y0(double x);
long double y0l(long double x);
float y0f(float x);
_Float16 y0f16(_Float16 x);

## y1

Description:
Computes the Bessel function (of the second kind) of
x
with order 1.
errno
: EDOM, for x <= 0
Calling interface:
double y1(double x);
long double y1l(long double x);
float y1f(float x);
_Float16 y1f16(_Float16 x);

## yn

Description:
Computes the Bessel function (of the second kind) of
x
with order
n
.
errno
: EDOM, for x <= 0
Calling interface:
double yn(int n, double x);
long double ynl(int n, long double x);
float ynf(int n, float x);
_Float16 ynf16(int n, _Float16 x);

#### Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.