# Special Functions

Many routines in the Intel® C++ Compiler Classic Math Library are more optimized for Intel® microprocessors than for non-Intel microprocessors.

The mathimf.h header file includes prototypes for Intel® C++ Compiler Classic Math Library functions.

The math library supports the following special functions:

## 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);`

## cdfnorm

Description: The cdfnorm function returns the cumulative normal distribution function value.

Calling interface:
`double cdfnorm(double x);`
`float cdfnormf(float 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

## 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);`

Parent topic: Intel® C++ Compiler Classic Math Library