# Trigonometric Functions

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

The mathimf.h header file includes prototypes for Intel® Math Library functions.

The Intel® Math Library supports the following trigonometric functions:

## acos

Description: The acos function returns the principal value of the inverse cosine of `x` in the range [0, pi] radians for `x` in the interval [-1,1].

errno: EDOM, for |x| > 1

Calling interface:
`double acos(double x);`
`long double acosl(long double x);`
`float acosf(float x);`

## acosd

Description: The acosd function returns the principal value of the inverse cosine of `x` in the range [0,180] degrees for `x` in the interval [-1,1].

errno: EDOM, for |x| > 1

Calling interface:
`double acosd(double x);`
`long double acosdl(long double x);`
`float acosdf(float x);`

## acospi

Description: The acospi function returns the principal value of the inverse cosine of `x`, divided by pi, in the range [0,1] for `x` in the interval [-1,1].

errno: EDOM, for |x| > 1

Calling interface:
`double acospi(double x);`
`float acospif(float x);`

## asin

Description: The asin function returns the principal value of the inverse sine of `x` in the range [-pi/2, +pi/2] radians for `x` in the interval [-1,1].

errno: EDOM, for |x| > 1

Calling interface:
`double asin(double x);`
`long double asinl(long double x);`
`float asinf(float x);`

## asind

Description: The asind function returns the principal value of the inverse sine of `x` in the range [-90,90] degrees for `x` in the interval [-1,1].

errno: EDOM, for |x| > 1

Calling interface:
`double asind(double x);`
`long double asindl(long double x);`
`float asindf(float x);`

## asinpi

Description: The asinpi function returns the principal value of the inverse sine of `x`, divided by pi, in the range [-1/2,1/2] degrees for `x` in the interval [-1,1].

errno: EDOM, for |x| > 1 divided by pi

Calling interface:
`double asinpi(double x);`
`float asinpif(float x);`

## atan

Description: The atan function returns the principal value of the inverse tangent of `x` in the range [-pi/2, +pi/2] radians.

Calling interface:
`double atan(double x);`
`long double atanl(long double x);`
`float atanf(float x);`

## atan2

Description: The atan2 function returns the principal value of the inverse tangent of `y/x` in the range [-pi, +pi] radians.

errno: EDOM, for x = 0 and y = 0

Calling interface:
`double atan2(double y, double x);`
`long double atan2l(long double y, long double x);`
`float atan2f(float y, float x);`

## atan2pi

Description: The atan2pi function returns the principal value of the inverse tangent of `y/x`, divided by pi, in the range [-1, +1].

errno: EDOM, for x = 0 and y = 0

Calling interface:
`double atan2pi(double y, double x);`
`float atan2pif(float y, float x);`

## atand

Description: The atand function returns the principal value of the inverse tangent of `x` in the range [-90,90] degrees.

Calling interface:
`double atand(double x);`
`long double atandl(long double x);`
`float atandf(float x);`

## atan2d

Description: The atan2d function returns the principal value of the inverse tangent of `y/x` in the range [-180, +180] degrees.

errno: EDOM, for x = 0 and y = 0.

Calling interface:
`double atan2d(double x, double y);`
`long double atan2dl(long double x, long double y);`
`float atan2df(float x, float y);`

## atanpi

Description: The atanpi function returns the principal value of the inverse tangent of `x`, divided by pi, in the range [-1/2, +1/2].

Calling interface:
`double atanpi(double x);`
`float atanpif(float x);`

## cos

Description: The cos function returns the cosine of `x` measured in radians.

Calling interface:
`double cos(double x);`
`long double cosl(long double x);`
`float cosf(float x);`

## cosd

Description: The cosd function returns the cosine of `x` measured in degrees.

Calling interface:
`double cosd(double x);`
`long double cosdl(long double x);`
`float cosdf(float x);`

## cospi

Description: The cospi function returns the cosine of `x` multiplied by pi, `cos(x*pi)`.

Calling interface:
`double cospi(double x);`
`float cospif(float x);`

## cot

Description: The cot function returns the cotangent of `x` measured in radians.

errno: ERANGE, for overflow conditions at x = 0.

Calling interface:
`double cot(double x);`
`long double cotl(long double x);`
`float cotf(float x);`

## cotd

Description: The cotd function returns the cotangent of `x` measured in degrees.

errno: ERANGE, for overflow conditions at x = 0.

Calling interface:
`double cotd(double x);`
`long double cotdl(long double x);`
`float cotdf(float x);`

## sin

Description: The sin function returns the sine of `x` measured in radians.

Calling interface:
`double sin(double x);`
`long double sinl(long double x);`
`float sinf(float x);`

## sincos

Description: The sincos function returns both the sine and cosine of `x` measured in radians.

Calling interface:
`void sincos(double x, double *sinval, double *cosval);`
`void sincosl(long double x, long double *sinval, long double *cosval);`
`void sincosf(float x, float *sinval, float *cosval);`

## sincosd

Description: The sincosd function returns both the sine and cosine of `x` measured in degrees.

Calling interface:
`void sincosd(double x, double *sinval, double *cosval);`
`void sincosdl(long double x, long double *sinval, long double *cosval);`
`void sincosdf(float x, float *sinval, float *cosval);`

## sind

Description: The sind function computes the sine of `x` measured in degrees.

Calling interface:
`double sind(double x);`
`long double sindl(long double x);`
`float sindf(float x);`

## sinpi

Description: The sinpi function returns the sine of `x` multiplied by pi, `sin(x*pi)`.

Calling interface:
`double sinpi(double x);`
`float sinpif(float x);`

## tan

Description: The tan function returns the tangent of `x` measured in radians.

Calling interface:
`double tan(double x);`
`long double tanl(long double x);`
`float tanf(float x);`

## tand

Description: The tand function returns the tangent of `x` measured in degrees.

errno: ERANGE, for overflow conditions

Calling interface:
`double tand(double x);`
`long double tandl(long double x);`
`float tandf(float x);`

## tanpi

Description: The tanpi function returns the tangent of `x` multiplied by pi, `tan(x*pi)`.

Calling interface:
`double tanpi(double x);`
`float tanpif(float x);`

Parent topic: Math Functions